From 6a31a7b024679c4dcbcf8120b06db0a17fa219ce Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 27 May 2020 16:26:37 +0200 Subject: Support winding fonts like Windows does Map Latin-1 characters to the Winding unicode entries for symbol fonts to render those fonts like Windows does. Pick-to: 5.15 Fixes: QTBUG-84409 Change-Id: I60b81d93412d970d25a98606545773db6c8ab723 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/freetype/qfontengine_ft.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui') diff --git a/src/gui/text/freetype/qfontengine_ft.cpp b/src/gui/text/freetype/qfontengine_ft.cpp index 1c9a17a3e4..35b6fb3831 100644 --- a/src/gui/text/freetype/qfontengine_ft.cpp +++ b/src/gui/text/freetype/qfontengine_ft.cpp @@ -1510,6 +1510,8 @@ glyph_t QFontEngineFT::glyphIndex(uint ucs4) const FT_Set_Charmap(face, freetype->symbol_map); glyph = FT_Get_Char_Index(face, ucs4); FT_Set_Charmap(face, freetype->unicode_map); + if (!glyph && symbol && ucs4 < 0x100) + glyph = FT_Get_Char_Index(face, ucs4 + 0xf000); } } if (ucs4 < QFreetypeFace::cmapCacheSize) @@ -1553,6 +1555,8 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs FT_Set_Charmap(face, freetype->symbol_map); glyph = FT_Get_Char_Index(face, uc); FT_Set_Charmap(face, freetype->unicode_map); + if (!glyph && symbol && uc < 0x100) + glyph = FT_Get_Char_Index(face, uc + 0xf000); } glyphs->glyphs[glyph_pos] = glyph; if (uc < QFreetypeFace::cmapCacheSize) -- cgit v1.2.3