diff options
author | Werner Lemberg <wl@gnu.org> | 2019-05-11 09:29:19 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2019-05-11 10:01:57 +0200 |
commit | 1178227b39a4eeecbefad226d4a753b345a16eb1 (patch) | |
tree | 6fa032908eef933fec86c310e2745493acdb0355 /include | |
parent | a113e5df0cc31425e7bb4135cd297305db33d0ed (diff) | |
download | freetype2-1178227b39a4eeecbefad226d4a753b345a16eb1.tar.gz |
[truetype] Increase precision of font variation (#54371).
This patch make FreeType use font units in 26.6 format internally
instead of integers.
* src/truetype/ttgxvar.c (FT_fixedToFdot6): New macro.
(TT_Vary_Apply_Glyph_Deltas): Add argument to output unrounded font
coordinates.
* src/truetype/ttgxvar.h: Updated.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Use
`extra_points2' array to temporarily hold unrounded point
coordinates; use them to compute scaled coordinates and linear
advance width and height.
(load_truetype_code): Adjust similarly.
Diffstat (limited to 'include')
-rw-r--r-- | include/freetype/freetype.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h index f758ea1c4..2f7863c4c 100644 --- a/include/freetype/freetype.h +++ b/include/freetype/freetype.h @@ -1766,6 +1766,13 @@ FT_BEGIN_HEADER * transformed, distorted, emboldened, etc. However, it must not be * freed. * + * [Since 2.10.1] If @FT_LOAD_NO_SCALE is set, outline coordinates of + * OpenType variation fonts for a selected instance are internally + * handled as 26.6 fractional font units but returned as (rounded) + * integers, as expected. To get unrounded font units, don't use + * @FT_LOAD_NO_SCALE but load the glyph with @FT_LOAD_NO_HINTING and + * scale it, using the font's `units_per_EM` value as the ppem. + * * num_subglyphs :: * The number of subglyphs in a composite glyph. This field is only * valid for the composite glyph format that should normally only be |