From a8e3245b50e1376aa3d3f2397ab10ecd5d6e6092 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 24 Mar 2015 04:42:03 +0400 Subject: [PATCH] Better detection of Symbol fonts > Symbol character sets have a special meaning. > If the symbol bit (31) is set, and the font file contains a 'cmap' > subtable for platform of 3 and encoding ID of 1, > then all of the characters in the Unicode range 0xF000 - 0xF0FF > (inclusive) will be used to enumerate the symbol character set. If we detected the font has a symbol character set, report no other writing systems support. Change-Id: I1030f3339c166ffd03c7caee1b1b26010dfdc314 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qplatformfontdatabase.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp index eec9dd905e7..5fa43948aad 100644 --- a/src/gui/text/qplatformfontdatabase.cpp +++ b/src/gui/text/qplatformfontdatabase.cpp @@ -525,7 +525,8 @@ enum { ThaiCsbBit = 16, JapaneseCsbBit = 17, KoreanCsbBit = 19, - KoreanJohabCsbBit = 21 + KoreanJohabCsbBit = 21, + SymbolCsbBit = 31 }; /*! @@ -610,6 +611,11 @@ QSupportedWritingSystems QPlatformFontDatabase::writingSystemsFromTrueTypeBits(q hasScript = true; //qDebug("font %s supports Korean", familyName.latin1()); } + if (codePageRange[0] & (1 << SymbolCsbBit)) { + writingSystems = QSupportedWritingSystems(); + hasScript = false; + } + if (!hasScript) writingSystems.setSupported(QFontDatabase::Symbol);