summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_mac.mm
diff options
context:
space:
mode:
authorAndy Shaw <qt-info@nokia.com>2011-03-30 13:33:12 (GMT)
committerAndy Shaw <qt-info@nokia.com>2011-03-30 13:33:12 (GMT)
commitb985b3dcec63b47825718d8a69c1307267b8bef0 (patch)
tree35e4b34e5623e90ebb2dc2a474acc7b944c5326f /src/gui/text/qfontengine_mac.mm
parentb3ba4b7de3bac0e444654fe150b4e5b3cc82fb39 (diff)
downloadQt-b985b3dcec63b47825718d8a69c1307267b8bef0.zip
Qt-b985b3dcec63b47825718d8a69c1307267b8bef0.tar.gz
Qt-b985b3dcec63b47825718d8a69c1307267b8bef0.tar.bz2
Ensure the right font is used for rendering text on Mac
When ATSFontGetName() did not set name to the font name then it would cause Qt to fall back to a font that was not the right one. Therefore calling ATSFontFamilyGetName() in this case will help ensure it gets the right font. Reviewed-by: Jiang
Diffstat (limited to 'src/gui/text/qfontengine_mac.mm')
-rw-r--r--src/gui/text/qfontengine_mac.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 42b9402..05e3d3c 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -144,7 +144,7 @@ void qmacfontengine_gamma_correct(QImage *image)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
-QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const ATSFontFamilyRef &, const ATSFontRef &atsFontRef, const QFontDef &fontDef, bool kerning)
+QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const ATSFontFamilyRef &atsFamilyRef, const ATSFontRef &atsFontRef, const QFontDef &fontDef, bool kerning)
: QFontEngineMulti(0)
{
this->fontDef = fontDef;
@@ -162,6 +162,8 @@ QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const ATSFontFamilyRef &, con
QCFString name;
ATSFontGetName(atsFontRef, kATSOptionFlagsDefault, &name);
+ if (QString(name).isEmpty())
+ ATSFontFamilyGetName(atsFamilyRef, kATSOptionFlagsDefault, &name);
transform = CGAffineTransformIdentity;
if (fontDef.stretch != 100) {