summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-02-16 11:30:37 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-02-16 11:39:08 (GMT)
commit529bca2a73a708fdf0d5b71a19e5636919e6254b (patch)
tree2805e3fa975661c21cedeeed1499e12e2d3054c5 /src/gui/text
parent7687b9dd937d8824ef8cbd69385ebe5b81b3885d (diff)
downloadQt-529bca2a73a708fdf0d5b71a19e5636919e6254b.zip
Qt-529bca2a73a708fdf0d5b71a19e5636919e6254b.tar.gz
Qt-529bca2a73a708fdf0d5b71a19e5636919e6254b.tar.bz2
Fix Thai text on Windows 7
Segoe UI, which is the default ui font on Windows 7, contains the glyph for a single character in the thai unicode range. This is thus detected as supporting the Thai script even though it only contains this one character, and as a result all thai text would appear as boxes on Windows 7 unless you changed the font. The patch is a temporary hack to work around the problem until a proper fix can be made. Reviewed-by: Lars Knoll
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontdatabase_win.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp
index 05c8f08..a6ceee1 100644
--- a/src/gui/text/qfontdatabase_win.cpp
+++ b/src/gui/text/qfontdatabase_win.cpp
@@ -336,8 +336,18 @@ void addFontToDatabase(QString familyName, const QString &scriptName,
signature->fsCsb[0], signature->fsCsb[1]
};
QList<QFontDatabase::WritingSystem> systems = determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
- for (int i = 0; i < systems.count(); ++i)
- family->writingSystems[systems.at(i)] = QtFontFamily::Supported;
+
+ for (int i = 0; i < systems.count(); ++i) {
+ QFontDatabase::WritingSystem writingSystem = systems.at(i);
+
+ // ### Hack to work around problem with Thai text on Windows 7. Segoe UI contains
+ // the symbol for Baht, and Windows thus reports that it supports the Thai script.
+ // Since it's the default UI font on this platform, most widgets will be unable to
+ // display Thai text by default. As a temporary work around, we special case Segoe UI
+ // and remove the Thai script from its list of supported writing systems.
+ if (writingSystem != QFontDatabase::Thai || familyName != QLatin1String("Segoe UI"))
+ family->writingSystems[writingSystem] = QtFontFamily::Supported;
+ }
} else if (!family->writingSystemCheck) {
//qDebug("family='%s' script=%s", family->name.latin1(), script.latin1());
if (scriptName == QLatin1String("Western")