[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Values of variables has changed after upgrading library.
From: |
Werner LEMBERG |
Subject: |
Re: Values of variables has changed after upgrading library. |
Date: |
Fri, 17 Sep 2021 06:45:23 +0000 (UTC) |
> In our product we are in process to upgrade freeType library from
> 2.0.9 to 2.10.0 version and compiled the library in 64Bit.
Why 2.10.0 and not the current one, 2.11.0?
> After loading the font using function FT_New_Memory_Face, the values
> of underline_position is coming different in comparing to newer and
> older versions. Due to this underline position in our output has
> moved a few pixels.
>
> For example: If we load 'Arial Regular' font, the value of
> underline_position in older version is -217 and in new version it is
> -292.
>
> Similarly after loading the Glyph the values of variables inside
> metrics are also different.
Version 2.0.9 is ancient, released in 2002. In version 2.3.8,
computation of the underline position has been fixed, taking care of
the underline thickness.
https://gitlab.freedesktop.org/freetype/freetype/-/commit/174b8de3283c921d8bddf48325fe42ba7330a930
In version 2.8, global metrics changed for TTFs. The corresponding
entry in the CHANGES file contains the following.
- 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.
Werner