Changeset 318
- Timestamp:
- Nov 13, 2009, 11:57:53 PM (16 years ago)
- Location:
- trunk/src/gui/text
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/text/qfontdatabase.cpp
r223 r318 145 145 uint yres = 0, uint avgwidth = 0, bool add = false); 146 146 #endif // Q_WS_X11 147 148 149 147 150 #if defined(Q_WS_QWS) || defined(Q_WS_PM) 148 151 QByteArray fileName; … … 224 227 free(pixelSizes[count].encodings); 225 228 #endif 229 230 231 226 232 #if defined(Q_WS_QWS) || defined(Q_WS_PM) 227 233 pixelSizes[count].fileName.~QByteArray(); … … 279 285 pixelSizes[count].count = 0; 280 286 pixelSizes[count].encodings = 0; 287 288 289 281 290 #endif 282 291 #if defined(Q_WS_QWS) || defined(Q_WS_PM) … … 965 974 #endif // Q_WS_X11 966 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 967 991 #if !defined(Q_WS_MAC) 968 992 static … … 1046 1070 } 1047 1071 #endif 1072 1073 1074 1075 1076 1077 1078 1048 1079 1049 1080 unsigned int d; … … 1090 1121 } 1091 1122 #endif // Q_WS_X11 1123 1124 1125 1126 1127 1128 1129 1130 1131 1092 1132 1093 1133 unsigned int this_score = 0x0000; -
trunk/src/gui/text/qfontdatabase_pm.cpp
r238 r318 295 295 else 296 296 cached.styleKey.weight = QFont::Black; 297 298 // @todo "Workplace Sans" from Alex Taylor has weight class 299 // < 400 whic makes it Light. It has some bad side effects 300 // in Qt, in particular, requesting Normal will select Bold 301 // instead of Light if "Workplace Sans Bold" is also installed. 302 // For this reason, we override the weight here. Remove the 303 // hack if the font is changed to Normal. 304 if (cached.familyName == QLatin1String("Workplace Sans")) { 305 if (cached.styleKey.weight == QFont::Light) 306 cached.styleKey.weight = QFont::Normal; 307 } 297 FD_DEBUG("os2_table->usWeightClass %u", os2_table->usWeightClass); 308 298 309 299 switch (os2_table->usWidthClass) { … … 329 319 cached.systems = 330 320 determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange); 321 331 322 } else { 332 323 // we've only got simple weight information and no stretch … … 402 393 family->fixedPitch = cached.fixedPitch; 403 394 404 if (cached.systems.isEmpty() || cached.familyName == QLatin1String("Workplace Sans")) {395 if (cached.systems.isEmpty()) { 405 396 // it was hard or impossible to determine the actual writing system 406 397 // of the font (as in case of OS/2 bitmap and PFB fonts for which it is 407 398 // usually simply reported that they support standard/system codepages). 408 399 // Pretend that we support all writing systems to not miss the one. 409 // Note that "Workplace Sans" TTF by Alex Taylor doesn't provide correct410 // unicode and codepage ranges in os2_table for some reason but versions411 // 0.4 and earlier are known to support many popular scripts so hack it.412 400 // 413 401 // @todo find a proper way to detect actual supported scripts to make 414 402 // sure these fonts are not matched for scripts they don't support. 415 //416 // @todo remove the hack for "Workplace Sans" once it is corrected417 403 for (int ws = 0; ws < QFontDatabase::WritingSystemsCount; ++ws) 418 404 family->writingSystems[ws] = QtFontFamily::Supported; … … 437 423 size->fileName = file; 438 424 size->fileIndex = cached.index; 425 439 426 } 440 427 … … 446 433 size->fileName = file; 447 434 size->fileIndex = cached.index; 435 448 436 } 449 437 }
Note:
See TracChangeset
for help on using the changeset viewer.