Changeset 846 for trunk/src/gui/text/qfont_s60.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/text/qfont_s60.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 41 41 42 42 #include "qfont.h" 43 #include "qt_s60_p.h" 44 #include "qpixmap_s60_p.h" 43 #include "qfont_p.h" 44 #include <private/qt_s60_p.h> 45 #include <private/qpixmap_s60_p.h> 45 46 #include "qmutex.h" 46 47 47 48 QT_BEGIN_NAMESPACE 48 49 49 #if 150 50 #ifdef QT_NO_FREETYPE 51 51 Q_GLOBAL_STATIC(QMutex, lastResortFamilyMutex); 52 extern QStringList qt_symbian_fontFamiliesOnFontServer(); // qfontdatabase_s60.cpp 53 Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, fontFamiliesOnFontServer, { 54 // We are only interested in the initial font families. No Application fonts. 55 // Therefore, we are allowed to cache the list. 56 x->append(qt_symbian_fontFamiliesOnFontServer()); 57 }); 52 58 #endif // QT_NO_FREETYPE 59 60 QString QFont::lastResortFont() const 61 { 62 // Symbian's font Api does not distinguish between font and family. 63 // Therefore we try to get a "Family" first, then fall back to "Sans". 64 static QString font = lastResortFamily(); 65 if (font.isEmpty()) 66 font = QLatin1String("Sans"); 67 return font; 68 } 53 69 54 70 QString QFont::lastResortFamily() const … … 71 87 } 72 88 return family; 73 #else 89 #else // QT_NO_FREETYPE 74 90 // For the FreeType case we just hard code the face name, since otherwise on 75 91 // East Asian systems we may get a name for a stroke based (non-ttf) font. … … 83 99 #endif // QT_NO_FREETYPE 84 100 } 85 #else // 086 QString QFont::lastResortFamily() const87 {88 return QLatin1String("Series 60 Sans");89 }90 #endif // 091 101 92 102 QString QFont::defaultFamily() const 93 103 { 104 #ifdef QT_NO_FREETYPE 105 switch(d->request.styleHint) { 106 case QFont::SansSerif: { 107 static const char* const preferredSansSerif[] = {"Nokia Sans S60", "Series 60 Sans"}; 108 for (int i = 0; i < sizeof preferredSansSerif / sizeof preferredSansSerif[0]; ++i) { 109 const QString sansSerif = QLatin1String(preferredSansSerif[i]); 110 if (fontFamiliesOnFontServer()->contains(sansSerif)) 111 return sansSerif; 112 } 113 } 114 // No break. Intentional fall through. 115 default: 116 return lastResortFamily(); 117 } 118 #endif // QT_NO_FREETYPE 94 119 return lastResortFamily(); 95 120 }
Note:
See TracChangeset
for help on using the changeset viewer.