1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
334 #endif |
334 #endif |
335 quint32 codePageRange[2] = { |
335 quint32 codePageRange[2] = { |
336 signature->fsCsb[0], signature->fsCsb[1] |
336 signature->fsCsb[0], signature->fsCsb[1] |
337 }; |
337 }; |
338 QList<QFontDatabase::WritingSystem> systems = determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange); |
338 QList<QFontDatabase::WritingSystem> systems = determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange); |
339 for (int i = 0; i < systems.count(); ++i) |
339 |
340 family->writingSystems[systems.at(i)] = QtFontFamily::Supported; |
340 for (int i = 0; i < systems.count(); ++i) { |
|
341 QFontDatabase::WritingSystem writingSystem = systems.at(i); |
|
342 |
|
343 // ### Hack to work around problem with Thai text on Windows 7. Segoe UI contains |
|
344 // the symbol for Baht, and Windows thus reports that it supports the Thai script. |
|
345 // Since it's the default UI font on this platform, most widgets will be unable to |
|
346 // display Thai text by default. As a temporary work around, we special case Segoe UI |
|
347 // and remove the Thai script from its list of supported writing systems. |
|
348 if (writingSystem != QFontDatabase::Thai || familyName != QLatin1String("Segoe UI")) |
|
349 family->writingSystems[writingSystem] = QtFontFamily::Supported; |
|
350 } |
341 } else if (!family->writingSystemCheck) { |
351 } else if (!family->writingSystemCheck) { |
342 //qDebug("family='%s' script=%s", family->name.latin1(), script.latin1()); |
352 //qDebug("family='%s' script=%s", family->name.latin1(), script.latin1()); |
343 if (scriptName == QLatin1String("Western") |
353 if (scriptName == QLatin1String("Western") |
344 || scriptName == QLatin1String("Baltic") |
354 || scriptName == QLatin1String("Baltic") |
345 || scriptName == QLatin1String("Central European") |
355 || scriptName == QLatin1String("Central European") |