From f34aaba8687a20794835e2dc878c52d1b53e6f85 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 28 Dec 2014 18:56:15 -0800 Subject: [PATCH] [ft] Don't set font ppem For discussion see: http://lists.freedesktop.org/archives/harfbuzz/2012-April/001905.html Over time we have had added NO_HINTING all over the place in hb-ft. Finish it off. Not setting ppem on hb-font disables get_contour_point() calls which is good anyway. See comments in the commit. --- src/hb-ft.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 9b2a90844..883f26f74 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -51,6 +51,13 @@ * In particular, FT_Get_Advance() without the NO_HINTING flag seems to be * buggy. * + * FreeType works in 26.6 mode. Clients can decide to use that mode, and everything + * would work fine. However, we also abuse this API for performing in font-space, + * but don't pass the correct flags to FreeType. We just abuse the no-hinting mode + * for that, such that no rounding etc happens. As such, we don't set ppem, and + * pass NO_HINTING around. This seems to work best, until we go ahead and add a full + * load_flags API. + * * - We don't handle / allow for emboldening / obliqueing. * * - In the future, we should add constructors to create fonts in font space? @@ -430,9 +437,11 @@ hb_ft_font_create (FT_Face ft_face, hb_font_set_scale (font, (int) (((uint64_t) ft_face->size->metrics.x_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16), (int) (((uint64_t) ft_face->size->metrics.y_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16)); +#if 0 /* hb-ft works in no-hinting model */ hb_font_set_ppem (font, ft_face->size->metrics.x_ppem, ft_face->size->metrics.y_ppem); +#endif return font; }