[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Font Height Problem
From: |
Werner LEMBERG |
Subject: |
Re: [ft] Font Height Problem |
Date: |
Sun, 28 Jul 2019 11:55:02 +0200 (CEST) |
> After upgrading from version 2.6.3 to 2.9.1, I noticed that the
> DejaVu Sans font (and some others) now appear to be taller (for the
> same font size) than before. For example, with DejaVu Sans Mono
> size 9.8 pt, the height increased by 2 pixels.
>
> I am absolutely sure that this is due to a change in FreeType,
> because installing the old version (2.6.3) restores the old font
> height.
>
> To correct the problem in the new version, I tried enabling autohint
> in the font configuration, and enabling AF_CONFIG_TT_SIZE_METRICS at
> compile-time, without success.
>
> Can someone explain what changed in FreeType, and how to get the old
> font height back?
I think you are referring to the following change in version 2.8.
- Global size metrics values in the `FT_Size_Metrics' structure
can be different for TrueType fonts. Reason is that in older
FreeType versions the metrics were rounded differently to
integer pixels compared to all other font formats, yielding an
inconsistent behaviour if you used non-native hinting. Starting
with this version, global size metrics for TrueType fonts are
handled the same as other font formats: `ascender' gets rounded
up, `descender' gets rounded down, `height' gets normally
rounded, and `max_advance' gets normally rounded, too.
If you need more precise values of (global) ascender, descender,
height, or `max_advance', please take the corresponding values
from the `FT_Face' structure and scale them manually.
Please adjust your font size values.
Werner