[iOS] GSFontAddCGFont is deprecated and we use it in DumpRenderTree
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Jul 2014 00:45:50 +0000 (00:45 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Jul 2014 00:45:50 +0000 (00:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134133

Reviewed by Simon Fraser.

Replace it with CTFontManagerRegisterGraphicsFont

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/mac/DumpRenderTree.mm:
(activateFontIOS):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170623 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
Tools/DumpRenderTree/mac/DumpRenderTree.mm

index 6fc51aa4339071846e258a807c36d290d636d9fc..5a6ee6ec8b556111f9ec7f7a7c9cf45a3c2bcbd3 100644 (file)
@@ -1,3 +1,16 @@
+2014-06-30  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [iOS] GSFontAddCGFont is deprecated and we use it in DumpRenderTree
+        https://bugs.webkit.org/show_bug.cgi?id=134133
+
+        Reviewed by Simon Fraser.
+
+        Replace it with CTFontManagerRegisterGraphicsFont
+
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (activateFontIOS):
+
 2014-06-30  Michael Saboff  <msaboff@apple.com>
 
         Add option to run-jsc-stress-testes to filter out tests that use large heaps
index 86bc074564997af441485833201530c84d9a01c3..2b078e2f7437703bd25eed3553a863fe683ff36f 100644 (file)
@@ -54,6 +54,7 @@
                1AD8683F163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD8683D163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp */; };
                1AD9D2FE12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */; };
                1AFF66BC137DEFD200791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */; };
+               1CB67420195BAE7B000F35B5 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CB6741F195BAE7B000F35B5 /* CoreText.framework */; };
                29CFBA11122736E600BC30C0 /* AccessibilityTextMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29CFBA0F122736E600BC30C0 /* AccessibilityTextMarker.cpp */; };
                29CFBA2E12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CFBA2D12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm */; };
                2CE88FA217124D8C00734FC0 /* JavaScriptThreading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CE88FA117124CEE00734FC0 /* JavaScriptThreading.cpp */; };
                1AD8683D163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeCallsWithNullNPP.cpp; sourceTree = "<group>"; };
                1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginScriptableNPObjectInvokeDefault.cpp; sourceTree = "<group>"; };
                1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetURLNotifyWithURLThatFailsToLoad.cpp; sourceTree = "<group>"; };
+               1CB6741F195BAE7B000F35B5 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
                23BCB88F0EA57623003C6289 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
                29CFBA0E122736E600BC30C0 /* AccessibilityTextMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTextMarker.h; sourceTree = "<group>"; };
                29CFBA0F122736E600BC30C0 /* AccessibilityTextMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTextMarker.cpp; sourceTree = "<group>"; };
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               1CB67420195BAE7B000F35B5 /* CoreText.framework in Frameworks */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                A803FF6409CAACC1009B2A37 /* Frameworks */ = {
                        isa = PBXGroup;
                        children = (
+                               1CB6741F195BAE7B000F35B5 /* CoreText.framework */,
                                1A7961061803454C00FE42CD /* IOKit.framework */,
                                BCB284B20CFA82CB007E533E /* ApplicationServices.framework */,
                                AE8257EF08D22389000507AB /* Carbon.framework */,
index f22c1006383d30f4331deea20aea90c983b37681..0cb42b2672952cd9a7008c74d1c8270aa3b4f35e 100644 (file)
@@ -99,7 +99,6 @@
 
 #if PLATFORM(IOS)
 #import <CoreGraphics/CGFontDB.h>
-#import <GraphicsServices/GSFont.h>
 #import <QuartzCore/QuartzCore.h>
 #import <UIKit/UIApplication_Private.h>
 #import <UIKit/UIMath.h>
@@ -529,8 +528,10 @@ static void activateFontIOS(const uint8_t* fontData, unsigned long length, std::
         exit(1);
     }
 
-    if (!GSFontAddCGFont(cgFont)) {
-        fprintf(stderr, "Failed to add CGFont to GraphicsServices for the %s font.\n", sectionName.c_str());
+    CFErrorRef error = nullptr;
+    CTFontManagerRegisterGraphicsFont(cgFont, &error);
+    if (error) {
+        fprintf(stderr, "Failed to add CGFont to CoreText for the %s font: %s.\n", sectionName.c_str(), CFStringGetCStringPtr(CFErrorCopyDescription(error), kCFStringEncodingUTF8));
         exit(1);
     }
     CGFontRelease(cgFont);