Title: [109137] trunk/Source/WebCore
Revision
109137
Author
[email protected]
Date
2012-02-28 12:28:53 -0800 (Tue, 28 Feb 2012)

Log Message

Reimplement pathFromFont() in SimpleFontDataMac.mm
https://bugs.webkit.org/show_bug.cgi?id=79811

Patch by Ned Holbrook <[email protected]> on 2012-02-28
Reviewed by Dan Bernstein.

Debug-only function, so no new tests.

* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::pathFromFont): Reimplemented.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (109136 => 109137)


--- trunk/Source/WebCore/ChangeLog	2012-02-28 20:25:32 UTC (rev 109136)
+++ trunk/Source/WebCore/ChangeLog	2012-02-28 20:28:53 UTC (rev 109137)
@@ -1,3 +1,15 @@
+2012-02-28  Ned Holbrook  <[email protected]>
+
+        Reimplement pathFromFont() in SimpleFontDataMac.mm
+        https://bugs.webkit.org/show_bug.cgi?id=79811
+
+        Reviewed by Dan Bernstein.
+
+        Debug-only function, so no new tests.
+
+        * platform/graphics/mac/SimpleFontDataMac.mm:
+        (WebCore::pathFromFont): Reimplemented.
+
 2012-02-28  Alexis Menard  <[email protected]>
 
         getComputedStyle fails for 'first-line' pseudo-element

Modified: trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm (109136 => 109137)


--- trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm	2012-02-28 20:25:32 UTC (rev 109136)
+++ trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm	2012-02-28 20:28:53 UTC (rev 109137)
@@ -82,31 +82,10 @@
 }
 
 #if !ERROR_DISABLED
-#if defined(__LP64__) || (!defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD))
-static NSString* pathFromFont(NSFont*)
+static NSString *pathFromFont(NSFont *font)
 {
-    // FMGetATSFontRefFromFont is not available. As pathFromFont is only used for debugging purposes,
-    // returning nil is acceptable.
-    return nil;
+    return [[[font fontDescriptor] objectForKey:(NSString *)kCTFontURLAttribute] path];
 }
-#else
-static NSString* pathFromFont(NSFont *font)
-{
-    ATSFontRef atsFont = FMGetATSFontRefFromFont(CTFontGetPlatformFont(toCTFontRef(font), 0));
-    FSRef fileRef;
-
-    OSStatus status = ATSFontGetFileReference(atsFont, &fileRef);
-    if (status != noErr)
-        return nil;
-
-    UInt8 filePathBuffer[PATH_MAX];
-    status = FSRefMakePath(&fileRef, filePathBuffer, PATH_MAX);
-    if (status == noErr)
-        return [NSString stringWithUTF8String:(const char*)filePathBuffer];
-
-    return nil;
-}
-#endif // __LP64__
 #endif // !ERROR_DISABLED
 
 void SimpleFontData::platformInit()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to