Reviewed by Oliver Hunt.
[WebKit-https.git] / WebCore / platform / graphics / mac / FontCustomPlatformData.cpp
index 0f61e9a2505e8904cd7aeec9a48d51a02729c90b..3c22288c78436f47f5a8e5d0a801ed088ef65a8f 100644 (file)
@@ -35,7 +35,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
 
 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic)
 {
-    return FontPlatformData(m_cgFont, FMGetFontFromATSFontRef(m_atsFont), size, bold, italic);
+    return FontPlatformData(m_cgFont, (ATSUFontID)m_atsFont, size, bold, italic);
 }
 
 FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
@@ -64,6 +64,10 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
     }
     
     CGFontRef cgFontRef = CGFontCreateWithPlatformFont(&fontRef);
+    if (!CGFontGetNumberOfGlyphs(cgFontRef)) {
+        CFRelease(cgFontRef);
+        cgFontRef = 0;
+    }
     if (!cgFontRef) {
         ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
         return 0;