- Timestamp:
- Oct 14, 2009, 11:07:33 PM (16 years ago)
- Location:
- trunk/src/gui/text
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/text/qfont_p.h
r2 r226 274 274 }; 275 275 276 #ifdef Q_WS_PM 277 Q_GUI_EXPORT const char *qt_fontFamilyFromStyleHint(const QFontDef &request); 278 #endif 279 276 280 QT_END_NAMESPACE 277 281 -
trunk/src/gui/text/qfont_pm.cpp
r95 r226 51 51 QT_BEGIN_NAMESPACE 52 52 53 Q_GUI_EXPORT const char *qt_fontFamilyFromStyleHint(const QFontDef &request) 54 { 55 const char *family = 0; 56 switch (request.styleHint) { 57 case QFont::Helvetica: 58 family = "Helvetica"; 59 break; 60 case QFont::Times: 61 case QFont::OldEnglish: 62 family = "Times New Roman"; 63 break; 64 case QFont::Courier: 65 family = "Courier"; 66 break; 67 case QFont::System: 68 family = "WarpSans"; 69 break; 70 case QFont::AnyStyle: 71 if (request.fixedPitch) 72 family = "Courier"; 73 else 74 family = "Helvetica"; 75 break; 76 } 77 return family; 78 } 79 53 80 /***************************************************************************** 54 81 QFont member functions … … 76 103 QString QFont::defaultFamily() const 77 104 { 78 switch(d->request.styleHint) { 79 case QFont::Times: 80 return QString::fromLatin1("Times New Roman"); 81 case QFont::Courier: 82 return QString::fromLatin1("Courier New"); 83 case QFont::Decorative: 84 return QString::fromLatin1("Bookman Old Style"); 85 case QFont::Helvetica: 86 return QString::fromLatin1("Arial"); 87 case QFont::System: 88 default: 89 return QString::fromLatin1("MS Sans Serif"); 90 } 105 return QLatin1String(qt_fontFamilyFromStyleHint(d->request)); 91 106 } 92 107 93 108 QString QFont::lastResortFamily() const 94 109 { 95 return QString::fromLatin1(" helvetica");110 return QString::fromLatin1("Helvetica"); 96 111 } 97 112 98 113 QString QFont::lastResortFont() const 99 114 { 100 return QString::fromLatin1(" arial");115 return QString::fromLatin1("Helvetica"); 101 116 } 102 117 -
trunk/src/gui/text/qfontdatabase_pm.cpp
r223 r226 302 302 } 303 303 304 static const char *styleHint(const QFontDef &request)305 {306 const char *stylehint = 0;307 switch (request.styleHint) {308 case QFont::SansSerif:309 stylehint = "Helvetica";310 break;311 case QFont::Serif:312 stylehint = "Roman";313 break;314 case QFont::TypeWriter:315 stylehint = "Courier";316 break;317 default:318 if (request.fixedPitch)319 stylehint = "Courier";320 else321 stylehint = "Helvetica";322 break;323 }324 return stylehint;325 }326 327 304 static QFontDef fontDescToFontDef(const QFontDef &req, const QtFontDesc &desc) 328 305 { … … 387 364 QStringList families = familyList(req); 388 365 389 const char *style hint = styleHint(d->request);390 if (style hint)391 families << QLatin1String(style hint);366 const char *styleHint = qt_fontFamilyFromStyleHint(d->request); 367 if (styleHint) 368 families << QLatin1String(styleHint); 392 369 393 370 // add the default family
Note:
See TracChangeset
for help on using the changeset viewer.