- Timestamp:
- Oct 14, 2009, 10:16:58 PM (16 years ago)
- Location:
- trunk/src/gui/text
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/text/qfontdatabase.cpp
r222 r223 446 446 // ### copied to tools/makeqpf/qpf2.cpp 447 447 448 #if ( defined(Q_WS_QWS) && !defined(QT_NO_FREETYPE)) || defined(Q_WS_WIN) || defined(Q_WS_MAC)448 #if ((defined(Q_WS_QWS) || defined(Q_WS_PM)) && !defined(QT_NO_FREETYPE)) || defined(Q_WS_WIN) || defined(Q_WS_MAC) 449 449 // see the Unicode subset bitfields in the MSDN docs 450 450 static int requiredUnicodeBits[QFontDatabase::WritingSystemsCount][2] = { -
trunk/src/gui/text/qfontdatabase_pm.cpp
r222 r223 133 133 QString familyName = QString::fromLatin1(face->family_name); 134 134 135 // familyName may contain extra spaces (at least this is true for 136 // TNR.PFB that is reported as "Times New Roman ". Trim them. 137 familyName = familyName.trimmed(); 138 135 139 QtFontStyle::Key styleKey; 136 140 137 141 styleKey.style = face->style_flags & FT_STYLE_FLAG_ITALIC ? 138 142 QFont::StyleItalic : QFont::StyleNormal; 143 144 QList<QFontDatabase::WritingSystem> systems; 139 145 140 146 TT_OS2 *os2_table = 0; … … 167 173 default: styleKey.stretch = QFont::Unstretched; break; 168 174 } 175 176 quint32 unicodeRange[4] = { 177 os2_table->ulUnicodeRange1, os2_table->ulUnicodeRange2, 178 os2_table->ulUnicodeRange3, os2_table->ulUnicodeRange4 179 }; 180 quint32 codePageRange[2] = { 181 os2_table->ulCodePageRange1, os2_table->ulCodePageRange2 182 }; 183 systems = determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange); 169 184 } else { 170 185 // we've only got simple weight information and no stretch … … 180 195 family->fixedPitch = face->face_flags & FT_FACE_FLAG_FIXED_WIDTH; 181 196 182 // writing systems aren't used ATM, let's support just Any 183 family->writingSystems[QFontDatabase::Any] = QtFontFamily::Supported; 197 if (systems.isEmpty()) { 198 // it was hard or impossible to determine the actual writing system 199 // of the font (as in case of OS/2 bitmap and PFB fonts for which it is 200 // usually simply reported that they support standard/system codepages). 201 // Pretend that we support all writing systems to not miss the one. 202 // @todo find a way to detect it properly to make sure these fonts 203 // are not matched for scripts they don't support 204 for (int ws = 0; ws < QFontDatabase::WritingSystemsCount; ++ws) 205 family->writingSystems[ws] = QtFontFamily::Supported; 206 } else { 207 for (int i = 0; i < systems.count(); ++i) 208 family->writingSystems[systems.at(i)] = QtFontFamily::Supported; 209 } 184 210 185 211 QtFontFoundry *foundry = family->foundry(foundryName, true); … … 235 261 populateDatabase(family->name); 236 262 #if 1 237 qDebug(" scripts supported:"); 238 for (int i = 0; i < QUnicodeTables::ScriptCount; i++) 239 if(family->writingSystems[i] & QtFontFamily::Supported) 240 qDebug(" %d", i); 263 qDebug(" writing systems supported:"); 264 QStringList systems; 265 for (int ws = 0; ws < QFontDatabase::WritingSystemsCount; ++ws) 266 if (family->writingSystems[ws] & QtFontFamily::Supported) 267 systems << QFontDatabase::writingSystemName((QFontDatabase::WritingSystem)ws); 268 qDebug() << " " << systems; 241 269 for (int fd = 0; fd < family->count; fd++) { 242 270 QtFontFoundry *foundry = family->foundries[fd];
Note:
See TracChangeset
for help on using the changeset viewer.