Index: Source/core/platform/graphics/cocoa/FontPlatformDataCocoa.mm |
diff --git a/Source/core/platform/graphics/cocoa/FontPlatformDataCocoa.mm b/Source/core/platform/graphics/cocoa/FontPlatformDataCocoa.mm |
index f82ed91af2291b7645cb009c1ebbe6a1f46678f2..ac239fa24ac43995573ee29dd379c9833b5f1263 100644 |
--- a/Source/core/platform/graphics/cocoa/FontPlatformDataCocoa.mm |
+++ b/Source/core/platform/graphics/cocoa/FontPlatformDataCocoa.mm |
@@ -78,7 +78,7 @@ FontPlatformData:: ~FontPlatformData() |
void FontPlatformData::platformDataInit(const FontPlatformData& f) |
{ |
- m_font = f.m_font && f.m_font != reinterpret_cast<NSFont *>(-1) ? const_cast<NSFont *>(static_cast<const NSFont *>(CFRetain(f.m_font))) : f.m_font; |
+ m_font = f.m_font && f.m_font != reinterpret_cast<NSFont *>(-1) ? [f.m_font retain] : f.m_font; |
m_cgFont = f.m_cgFont; |
m_CTFont = f.m_CTFont; |
@@ -233,23 +233,13 @@ static CTFontDescriptorRef cascadeToLastResortAndDisableSwashesFontDescriptor() |
return descriptor; |
} |
-// Adding a cascade list breaks the font on Leopard |
-static bool canSetCascadeListForCustomFont() |
-{ |
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 |
- return true; |
-#else |
- return false; |
-#endif |
-} |
- |
CTFontRef FontPlatformData::ctFont() const |
{ |
if (m_CTFont) |
return m_CTFont.get(); |
if (m_inMemoryFont) { |
- m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_inMemoryFont->cgFont(), m_size, 0, canSetCascadeListForCustomFont() ? cascadeToLastResortFontDescriptor() : 0)); |
+ m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_inMemoryFont->cgFont(), m_size, 0, cascadeToLastResortFontDescriptor())); |
return m_CTFont.get(); |
} |
@@ -264,7 +254,7 @@ CTFontRef FontPlatformData::ctFont() const |
fontDescriptor = cascadeToLastResortFontDescriptor(); |
m_CTFont.adoptCF(CTFontCreateCopyWithAttributes(m_CTFont.get(), m_size, 0, fontDescriptor)); |
} else |
- m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, canSetCascadeListForCustomFont() ? cascadeToLastResortFontDescriptor() : 0)); |
+ m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor())); |
if (m_widthVariant != RegularWidth) { |
int featureTypeValue = kTextSpacingType; |