[PATCH] gdi32: Retry with hinting disabled if glyph load failed in hinted mode.
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- Freetype bug with test font is at https://savannah.nongnu.org/bugs/?57732. It doesn't seem practical to try and cherry pick specific error codes that might indicate hinting system problems. dlls/gdi32/freetype.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 10127bb77a..b806b62b77 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -7620,6 +7620,12 @@ 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); -- 2.24.1
Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
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);
It would be better to use same format string as in the WARN() below this one.
+ 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);
-- Dmitry.
participants (2)
-
Dmitry Timoshkov -
Nikolay Sivov