Nikolay Sivov : gdi32: Retry with hinting disabled if glyph load failed in hinted mode.

Alexandre Julliard julliard at winehq.org
Wed Feb 5 16:53:34 CST 2020


Module: wine
Branch: master
Commit: dc9267dc1c73d297deffb5b80a305333cb26501c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=dc9267dc1c73d297deffb5b80a305333cb26501c

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Feb  5 13:17:35 2020 +0300

gdi32: Retry with hinting disabled if glyph load failed in hinted mode.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/freetype.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 10127bb77a..03bd097af2 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -7620,9 +7620,15 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
     if (vertical_metrics) load_flags |= FT_LOAD_VERTICAL_LAYOUT;
 
     err = pFT_Load_Glyph(ft_face, glyph_index, load_flags);
+    if (err && !(load_flags & FT_LOAD_NO_HINTING))
+    {
+        WARN("Failed to load glyph %#x, retrying without hinting. Error %#x.\n", glyph_index, err);
+        load_flags |= FT_LOAD_NO_HINTING;
+        err = pFT_Load_Glyph(ft_face, glyph_index, load_flags);
+    }
 
     if(err) {
-        WARN("FT_Load_Glyph on index %x returns %d\n", glyph_index, err);
+        WARN("Failed to load glyph %#x, error %#x.\n", glyph_index, err);
         return GDI_ERROR;
     }
 




More information about the wine-cvs mailing list