From 79c5bb92ce0609af093f23d8bfa5b092cfe09111 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 24 Dec 2022 12:57:33 -0700 Subject: [PATCH] [ft] Work around a freetype bug --- src/hb-ft.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hb-ft.cc b/src/hb-ft.cc index de53936f6..337909559 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -462,6 +462,9 @@ hb_ft_get_glyph_h_advances (hb_font_t* font, void* font_data, else { FT_Get_Advance (ft_face, glyph, load_flags, &v); + /* Work around bug that FreeType seems to return negative advance + * for variable-set fonts if x_scale is negative! */ + v = abs (v); ft_font->advance_cache.set (glyph, v); }