summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-05-27 16:26:37 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-06-03 18:40:23 +0200
commit6a31a7b024679c4dcbcf8120b06db0a17fa219ce (patch)
treefa0810a50869ec1211e5aab1402349e3dd876e28 /src/gui
parent33e6e5fac3c86805b1b4e744462645cac8c8a044 (diff)
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 <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/freetype/qfontengine_ft.cpp4
1 files changed, 4 insertions, 0 deletions
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)