From 719adaaa12991530d066bef4b65257ef66dd951c Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 5 Aug 2013 09:55:35 -0400 Subject: Return the correct system font on OS X Mavericks. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also prints a warning if other private system fonts are encountered. Task-number: QTBUG-32789 Change-Id: I04e1471d25119caddb587972561e98defb1ffda1 Reviewed-by: Tor Arne Vestbø --- src/gui/kernel/qt_mac.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/kernel/qt_mac.cpp b/src/gui/kernel/qt_mac.cpp index 5d9c03e..ef0df5f 100644 --- a/src/gui/kernel/qt_mac.cpp +++ b/src/gui/kernel/qt_mac.cpp @@ -67,6 +67,13 @@ QFont qfontForThemeFont(ThemeFontID themeID) #else QCFType ctfont = CopyCTThemeFont(themeID); QString familyName = QCFString(CTFontCopyFamilyName(ctfont)); + + // Fix for the new private UI font on Mavericks + if (familyName == QLatin1String(".Lucida Grande UI")) + familyName = QLatin1String("Lucida Grande"); + else if (familyName.startsWith(QLatin1String("."))) + qWarning("Qt: qfontForThemeFont: encountered unknown private system font: %s", familyName.toLatin1().constData()); + QCFType dict = CTFontCopyTraits(ctfont); CFNumberRef num = static_cast(CFDictionaryGetValue(dict, kCTFontWeightTrait)); float fW; -- cgit v0.12