summaryrefslogtreecommitdiff
path: root/ports/SkFontHost_mac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ports/SkFontHost_mac.cpp')
-rwxr-xr-xports/SkFontHost_mac.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/ports/SkFontHost_mac.cpp b/ports/SkFontHost_mac.cpp
index 3c1a2748..fe3fd069 100755
--- a/ports/SkFontHost_mac.cpp
+++ b/ports/SkFontHost_mac.cpp
@@ -2107,7 +2107,13 @@ static SkTypeface* createFromDesc(CFStringRef cfFamilyName,
return face;
}
- AutoCFRelease<CTFontRef> ctNamed(CTFontCreateWithName(cfFamilyName, 1, NULL));
+ AutoCFRelease<CFDictionaryRef> fontFamilyNameDictionary(
+ CFDictionaryCreate(kCFAllocatorDefault,
+ (const void**)&kCTFontFamilyNameAttribute, (const void**)&cfFamilyName,
+ 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+ AutoCFRelease<CTFontDescriptorRef> fontDescriptor(
+ CTFontDescriptorCreateWithAttributes(fontFamilyNameDictionary));
+ AutoCFRelease<CTFontRef> ctNamed(CTFontCreateWithFontDescriptor(fontDescriptor, 0, NULL));
CTFontRef ctFont = CTFontCreateCopyWithAttributes(ctNamed, 1, NULL, desc);
if (NULL == ctFont) {
return NULL;