diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-04-27 14:21:54 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-04-27 16:36:38 +0200 |
commit | f0faf4011e1128ab5e58ce3912d379481f8320cb (patch) | |
tree | 1628b3ea0b9119eb9af6fbddd68d9b820c5ce2a6 /src/gui/text/qfontengine_coretext.mm | |
parent | c501403cb5a0c9ec21b00e0c2f640ae85566e0cf (diff) |
Make QtQuick2 compile on QPA
Moved the logic to set pixel size into the font engines to avoid
making the platform plugin interface too complex, and added a function
in QPA to make an isolated font engine based on font data. Currently
none of the QPA back-ends supports it, but it compiles and spits out
a warning if you try to create a QRawFont from data there. This isn't
used in QtQuick2 anyway.
Reviewed-by: Jiang Jiang
Diffstat (limited to 'src/gui/text/qfontengine_coretext.mm')
-rw-r--r-- | src/gui/text/qfontengine_coretext.mm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm index 51e14b164c..d4df2183ed 100644 --- a/src/gui/text/qfontengine_coretext.mm +++ b/src/gui/text/qfontengine_coretext.mm @@ -865,6 +865,15 @@ QFixed QCoreTextFontEngine::emSquareSize() const return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont))); } +QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const +{ + QFontDef newFontDef = fontDef; + newFontDef.pixelSize = pixelSize; + newFontDef.pointSize = pixelSize * 72.0 / qt_defaultDpi(); + + return new QCoreTextFontEngine(cgFont, fontDef); +} + QT_END_NAMESPACE #endif// !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) |