From 1c00a46c7a608ebc0b03c5abfcfe7f2b9881d0df Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Wed, 30 Mar 2016 20:15:09 +0000 Subject: [PATCH] Make DirectWrite backend to work with different font sizes Actually copyedited same logic from Uniscribe to make it just work --- src/hb-directwrite.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hb-directwrite.cc b/src/hb-directwrite.cc index af0fd3da0..fd8ab5cfe 100644 --- a/src/hb-directwrite.cc +++ b/src/hb-directwrite.cc @@ -739,6 +739,11 @@ _hb_directwrite_shape(hb_shape_plan_t *shape_plan, #undef ALLOCATE_ARRAY + int font_size = font->face->get_upem(); + if (font_size < 0) + font_size = -font_size; + int x_mult = (double)font->x_scale / font_size; + hr = analyzer->GetGlyphPlacements(pchars, clusters, textProperties, @@ -747,7 +752,7 @@ _hb_directwrite_shape(hb_shape_plan_t *shape_plan, glyphProperties, actualGlyphs, fontFace, - face->get_upem(), + font_size * x_mult, FALSE, FALSE, &runHead->mScript,