Index: src/ports/SkFontHost_mac.cpp |
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp |
index 3c1a274887728feebe9570ce5f4c0ce56eae247f..0c8728a5fc004c7b49907a2a071620025c48b737 100755 |
--- a/src/ports/SkFontHost_mac.cpp |
+++ b/src/ports/SkFontHost_mac.cpp |
@@ -2107,7 +2107,11 @@ static SkTypeface* createFromDesc(CFStringRef cfFamilyName, |
return face; |
} |
- AutoCFRelease<CTFontRef> ctNamed(CTFontCreateWithName(cfFamilyName, 1, NULL)); |
+ CTFontDescriptorRef descriptor = CTFontDescriptorCreateWithAttributes( |
bungeman-skia
2013/12/09 15:46:12
This create, I'm fairly certain, needs to be unref
|
+ CFDictionaryCreate(kCFAllocatorDefault, |
+ (const void**)&kCTFontFamilyNameAttribute, (const void**)&cfFamilyName, |
+ 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); |
+ AutoCFRelease<CTFontRef> ctNamed(CTFontCreateWithFontDescriptor(descriptor, 0, NULL)); |
CTFontRef ctFont = CTFontCreateCopyWithAttributes(ctNamed, 1, NULL, desc); |
if (NULL == ctFont) { |
return NULL; |