Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: webkit/tools/test_shell/test_shell_mac.mm

Issue 10867081: mac 10.8: Switch test_shell_mac from ATS to CoreText font registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_shell_mac.mm
diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm
index 258834bd7ae6c4c360eb1593daa93860ab4fc3a4..ccfaa670aa3a4e46541a7b260418575ad34f6832 100644
--- a/webkit/tools/test_shell/test_shell_mac.mm
+++ b/webkit/tools/test_shell/test_shell_mac.mm
@@ -223,25 +223,15 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
ResetWebPreferences();
// Load the Ahem font, which is used by layout tests.
- const char* ahem_path_c;
NSString* ahem_path = [[base::mac::FrameworkBundle() resourcePath]
stringByAppendingPathComponent:@"AHEM____.TTF"];
- ahem_path_c = [ahem_path fileSystemRepresentation];
- FSRef ahem_fsref;
- if (!base::mac::FSRefFromPath(ahem_path_c, &ahem_fsref)) {
- DLOG(FATAL) << "FSRefFromPath " << ahem_path_c;
- } else {
- // The last argument is an ATSFontContainerRef that can be passed to
- // ATSFontDeactivate to unload the font. Since the font is only loaded
- // for this process, and it's always wanted, don't keep track of it.
- if (ATSFontActivateFromFileReference(&ahem_fsref,
- kATSFontContextLocal,
- kATSFontFormatUnspecified,
- NULL,
- kATSOptionFlagsDefault,
- NULL) != noErr) {
- DLOG(FATAL) << "ATSFontActivateFromFileReference " << ahem_path_c;
- }
+ NSURL* ahem_path_url = [NSURL fileURLWithPath:ahem_path];
+ CFErrorRef error;
+ if (!CTFontManagerRegisterFontsForURL((CFURLRef)ahem_path_url,
+ kCTFontManagerScopeProcess, &error)) {
+ DLOG(FATAL) << "CTFontManagerRegisterFontsForURL "
+ << [ahem_path fileSystemRepresentation]
+ << [[(NSError*)error description] UTF8String];
}
// Add <app bundle's parent dir>/plugins to the plugin path so we can load
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698