Index: src/ports/SkFontHost_mac.cpp |
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp |
index 3c1a274887728feebe9570ce5f4c0ce56eae247f..fe3fd069817be56a3406d2b03c57ca7882812e91 100755 |
--- a/src/ports/SkFontHost_mac.cpp |
+++ b/src/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; |