Changeset 846 for trunk/src/gui/text/qfontdatabase_x11.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/qfontdatabase_x11.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) … … 42 42 #include <qplatformdefs.h> 43 43 44 #include <qdatetime.h>45 44 #include <qdebug.h> 46 45 #include <qpaintdevice.h> 46 #include <qelapsedtimer.h> 47 47 48 48 #include <private/qt_x11_p.h> … … 78 78 extern double qt_pointSize(double pixelSize, int dpi); 79 79 extern double qt_pixelSize(double pointSize, int dpi); 80 81 // from qapplication.cpp 82 extern bool qt_is_gui_used; 80 83 81 84 static inline void capitalize (char *s) … … 1219 1222 1220 1223 #ifdef QFONTDATABASE_DEBUG 1221 Q Timet;1224 QElapsedTimer t; 1222 1225 t.start(); 1223 1226 #endif … … 1302 1305 return; 1303 1306 1304 Q Timet;1307 QElapsedTimer t; 1305 1308 t.start(); 1306 1309 … … 1315 1318 1316 1319 loadFontConfig(); 1317 FD_DEBUG("QFontDatabase: loaded FontConfig: %d ms", t.elapsed());1320 FD_DEBUG("QFontDatabase: loaded FontConfig: %d ms", int(t.elapsed())); 1318 1321 #endif 1319 1322 … … 1889 1892 } 1890 1893 1894 #if (defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6)) && defined(Q_CC_GNU) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) 1895 #define NEEDS_GCC_BUG_WORKAROUND 1896 #endif 1897 1898 #ifdef NEEDS_GCC_BUG_WORKAROUND 1899 static inline void gccBugWorkaround(const QFontDef &req) 1900 { 1901 char buffer[8]; 1902 snprintf(buffer, 8, "%f", req.pixelSize); 1903 } 1904 #endif 1905 1891 1906 /*! \internal 1892 1907 Loads a QFontEngine for the specified \a script that matches the … … 1900 1915 QFontDef req = d->request; 1901 1916 if (req.pixelSize <= 0) 1902 req.pixelSize = floor(qt_pixelSize(req.pointSize, d->dpi) * 100 + 0.5) / 100;1917 req.pixelSize = qFloor(qt_pixelSize(req.pointSize, d->dpi) * 100.0 + 0.5) * 0.01; 1903 1918 if (req.pixelSize < 1) 1904 1919 req.pixelSize = 1; 1920 1921 #ifdef NEEDS_GCC_BUG_WORKAROUND 1922 // req.pixelSize ends up with a bogus value unless this workaround is called 1923 gccBugWorkaround(req); 1924 #endif 1925 1905 1926 if (req.weight == 0) 1906 1927 req.weight = QFont::Normal; … … 1938 1959 } else if (X11->has_fontconfig) { 1939 1960 fe = loadFc(d, script, req); 1940 1941 if (fe != 0 && fe->fontDef.pixelSize != req.pixelSize) { 1942 delete fe; 1943 fe = loadXlfd(d->screen, script, req); 1961 if (fe != 0 && fe->fontDef.pixelSize != req.pixelSize && mainThread && qt_is_gui_used) { 1962 QFontEngine *xlfdFontEngine = loadXlfd(d->screen, script, req); 1963 if (xlfdFontEngine->fontDef.family == fe->fontDef.family) { 1964 delete fe; 1965 fe = xlfdFontEngine; 1966 } else { 1967 delete xlfdFontEngine; 1968 } 1944 1969 } 1945 1970 1946 1971 1947 1972 #endif 1948 } else if (mainThread ) {1973 } else if (mainThread && qt_is_gui_used) { 1949 1974 fe = loadXlfd(d->screen, script, req); 1950 1975 } … … 1982 2007 FcFontSet *set = FcConfigGetFonts(config, FcSetApplication); 1983 2008 if (!set) { 1984 FcConfigAppFontAddFile(config, (const FcChar8 *)":/non-exist ant");2009 FcConfigAppFontAddFile(config, (const FcChar8 *)":/non-existent"); 1985 2010 set = FcConfigGetFonts(config, FcSetApplication); // try again 1986 2011 if (!set)
Note:
See TracChangeset
for help on using the changeset viewer.