diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2012-03-30 14:23:36 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-10 12:49:34 +0200 |
commit | ef4783d2978ec5edf1b90ef5a13467c6c9ee3df6 (patch) | |
tree | 94a5ec1ae57db8aadf7a1a3a5c3ab4a957b8c98d /src/gui/text/qfontdatabase_qpa.cpp | |
parent | a159ca80d73f07d617d6edd9b3e59bda25449a1c (diff) |
Make it possible to enable non-scalable font scaling
Windows native font engine supports scaling of non-scalalble fonts, so
make it possible to do so.
Added two functions to QPlatformFontDatabase: fontsAlwaysScalable() and
standardSizes(), and made fontsAlwaysScalable() to return true for
Windows native font database.
Windows Freetype font engine doesn't seem to support scaling of
non-scalable fonts, so didn't enable it in there.
Added implementation of standardSizes() for Mac OS.
Task-number: QTBUG-24970
Change-Id: I41c9356ede8a37b7c61db94340dbeb5b629f34b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src/gui/text/qfontdatabase_qpa.cpp')
-rw-r--r-- | src/gui/text/qfontdatabase_qpa.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index 0014efc450..c2a3aa9722 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -161,9 +161,12 @@ QFontEngine *loadSingleEngine(int script, Q_UNUSED(foundry); Q_ASSERT(size); + QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); int pixelSize = size->pixelSize; - if (!pixelSize || (style->smoothScalable && pixelSize == SMOOTH_SCALABLE)) + if (!pixelSize || (style->smoothScalable && pixelSize == SMOOTH_SCALABLE) + || pfdb->fontsAlwaysScalable()) { pixelSize = request.pixelSize; + } QFontDef def = request; def.pixelSize = pixelSize; @@ -171,7 +174,6 @@ QFontEngine *loadSingleEngine(int script, QFontCache::Key key(def,script); QFontEngine *engine = QFontCache::instance()->findEngine(key); if (!engine) { - QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); engine = pfdb->fontEngine(def,QUnicodeTables::Script(script),size->handle); if (engine) { QFontCache::Key key(def,script); |