{ return QCFString::toQString(reinterpret_cast<const CFStringRef>(nsstr)); }
int qt_antialiasing_threshold = 0;
+bool qt_enable_font_smoothing = true;
QFont::StyleHint styleHintFromNSString(NSString *style)
{
QVariant appleValue = appleSettings.value(QLatin1String("AppleAntiAliasingThreshold"));
if (appleValue.isValid())
qt_antialiasing_threshold = appleValue.toInt();
+
+ appleValue = appleSettings.value(QLatin1String("AppleFontSmoothing"));
+ // Only disable font smoothing when AppleFontSmoothing is set to 0,
+ // empty or non-zero means enabled
+ if (appleValue.isValid() && appleValue.toInt() == 0)
+ qt_enable_font_smoothing = false;
}
QCoreTextFontDatabase::~QCoreTextFontDatabase()
Q_ASSERT(false);
}
-extern int qt_antialiasing_threshold; // from qapplication.cpp
+extern int qt_antialiasing_threshold, qt_enable_font_smoothing;
CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef)
{
Q_ASSERT(ctfont != NULL);
Q_ASSERT(cgFont != NULL);
+ glyphFormat = qt_enable_font_smoothing ? QFontEngineGlyphCache::Raster_RGBMask
+ : QFontEngineGlyphCache::Raster_A8;
+
QCFString family = CTFontCopyFamilyName(ctfont);
fontDef.family = family;