Detect Thai writing system support from the font's Code Page Bitfields

https://msdn.microsoft.com/en-us/library/windows/desktop/dd317754(v=vs.85).aspx

Change-Id: I893746210dc71b9de6f6c064fd9fcaf6340e3c71
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This commit is contained in:
Konstantin Ritt 2015-03-24 03:22:38 +04:00
parent 02d6fff193
commit 951e8a52ae

View File

@ -522,6 +522,7 @@ enum {
VietnameseCsbBit = 8,
SimplifiedChineseCsbBit = 18,
TraditionalChineseCsbBit = 20,
ThaiCsbBit = 16,
JapaneseCsbBit = 17,
KoreanCsbBit = 19,
KoreanJohabCsbBit = 21
@ -579,6 +580,11 @@ QSupportedWritingSystems QPlatformFontDatabase::writingSystemsFromTrueTypeBits(q
hasScript = true;
//qDebug("font %s supports Arabic", familyName.latin1());
}
if (codePageRange[0] & (1 << ThaiCsbBit)) {
writingSystems.setSupported(QFontDatabase::Thai);
hasScript = true;
//qDebug("font %s supports Thai", familyName.latin1());
}
if (codePageRange[0] & (1 << VietnameseCsbBit)) {
writingSystems.setSupported(QFontDatabase::Vietnamese);
hasScript = true;