mirror of https://github.com/vitalif/phantomjs
Fix CoreText performance note on OS X 10.9 (Mavericks).
Upstream Qt bug: https://bugreports.qt-project.org/browse/QTBUG-32789 Upstream patch: https://codereview.qt-project.org/#patch,all,70097,4. Upstream commit: https://qt.gitorious.org/qt/qt/commit/98352b964f https://github.com/ariya/phantomjs/issues/114181.x
parent
9b0132712b
commit
b67866b612
|
@ -1968,6 +1968,8 @@ static void initFontSubst()
|
|||
"times new roman", "times",
|
||||
"courier new", "courier",
|
||||
"sans serif", "helvetica",
|
||||
#elif defined(Q_WS_MAC)
|
||||
".lucida grande ui", "lucida grande",
|
||||
#elif defined(Q_WS_WIN)
|
||||
"times", "times new roman",
|
||||
"courier", "courier new",
|
||||
|
|
|
@ -325,9 +325,15 @@ static QFontEngine *loadFromDatabase(QFontDef &req, const QFontPrivate *d)
|
|||
for (int i = 0; i < family_list.size(); ++i) {
|
||||
for (int k = 0; k < db->count; ++k) {
|
||||
if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) {
|
||||
QByteArray family_name = db->families[k]->name.toUtf8();
|
||||
#if defined(QT_MAC_USE_COCOA)
|
||||
QCFType<CTFontRef> ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL);
|
||||
CFStringRef familyName = QCFString::toCFStringRef(db->families[k]->name);
|
||||
QCFType<CTFontDescriptorRef> descriptor = CTFontDescriptorCreateWithAttributes(
|
||||
QCFType<CFDictionaryRef>(CFDictionaryCreate(kCFAllocatorDefault,
|
||||
(const void**)&kCTFontFamilyNameAttribute,
|
||||
(const void**)&familyName, 1,
|
||||
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)));
|
||||
CFRelease(familyName);
|
||||
QCFType<CTFontRef> ctFont = CTFontCreateWithFontDescriptor(descriptor, 0, NULL);
|
||||
if (ctFont) {
|
||||
fontName = CTFontCopyFullName(ctFont);
|
||||
goto found;
|
||||
|
|
Loading…
Reference in New Issue