Changeset 181569 in webkit
- Timestamp:
- Mar 16, 2015, 11:30:34 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac-mavericks/fast/forms/text-control-intrinsic-widths-expected.txt (deleted)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/DumpRenderTree/mac/DumpRenderTree.mm (modified) (2 diffs)
-
Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181566 r181569 1 2015-03-16 Alexey Proskuryakov <ap@apple.com> 2 3 [Mac] fast/forms/text-control-intrinsic-widths.html fails when MS Office is installed 4 https://bugs.webkit.org/show_bug.cgi?id=142720 5 6 Reviewed by Myles C. Maxfield. 7 8 * platform/mac-mavericks/fast/forms/text-control-intrinsic-widths-expected.txt: Removed. 9 Mavericks result is no different from Yosemite. 10 1 11 2015-03-16 Brent Fulgham <bfulgham@apple.com> 2 12 -
trunk/Tools/ChangeLog
r181532 r181569 1 2015-03-16 Alexey Proskuryakov <ap@apple.com> 2 3 [Mac] fast/forms/text-control-intrinsic-widths.html fails when MS Office is installed 4 https://bugs.webkit.org/show_bug.cgi?id=142720 5 6 Reviewed by Myles C. Maxfield. 7 8 Activate system copies of Microsoft fonts for the current process, thus overriding 9 any other ones that could be preferred by the system otherwise. 10 11 * DumpRenderTree/mac/DumpRenderTree.mm: 12 (activateSystemCoreWebFonts): 13 (adjustFonts): 14 * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: 15 (WTR::activateSystemCoreWebFonts): 16 (WTR::activateFonts): 17 1 18 2015-03-16 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 19 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r181359 r181569 474 474 } 475 475 476 // Activating system copies of these fonts overrides any others that could be preferred, such as ones 477 // in /Library/Fonts/Microsoft, and which don't always have the same metrics. 478 // FIXME: Switch to a solution from <rdar://problem/19553550> once it's available. 479 static void activateSystemCoreWebFonts() 480 { 481 NSArray *coreWebFontNames = @[ 482 @"Andale Mono", 483 @"Arial", 484 @"Arial Black", 485 @"Comic Sans MS", 486 @"Courier New", 487 @"Georgia", 488 @"Impact", 489 @"Times New Roman", 490 @"Trebuchet MS", 491 @"Verdana", 492 @"Webdings" 493 ]; 494 495 NSArray *fontFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:[NSURL fileURLWithPath:@"/Library/Fonts" isDirectory:YES] 496 includingPropertiesForKeys:@[NSURLFileResourceTypeKey, NSURLNameKey] options:0 error:0]; 497 498 for (NSURL *fontURL in fontFiles) { 499 NSString *resourceType; 500 NSString *fileName; 501 if (![fontURL getResourceValue:&resourceType forKey:NSURLFileResourceTypeKey error:0] 502 || ![fontURL getResourceValue:&fileName forKey:NSURLNameKey error:0]) 503 continue; 504 if (![resourceType isEqualToString:NSURLFileResourceTypeRegular]) 505 continue; 506 507 // Activate all font variations, such as Arial Bold Italic.ttf. This algorithm is not 100% precise, as it 508 // also activates e.g. Arial Unicode, which is not a variation of Arial. 509 for (NSString *coreWebFontName in coreWebFontNames) { 510 if ([fileName hasPrefix:coreWebFontName]) { 511 CTFontManagerRegisterFontsForURL((CFURLRef)fontURL, kCTFontManagerScopeProcess, 0); 512 break; 513 } 514 } 515 } 516 } 517 476 518 static void activateTestingFonts() 477 519 { … … 509 551 { 510 552 swizzleNSFontManagerMethods(); 553 activateSystemCoreWebFonts(); 511 554 activateTestingFonts(); 512 555 } -
trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm
r180557 r181569 242 242 } 243 243 244 // Activating system copies of these fonts overrides any others that could be preferred, such as ones 245 // in /Library/Fonts/Microsoft, and which don't always have the same metrics. 246 // FIXME: Switch to a solution from <rdar://problem/19553550> once it's available. 247 static void activateSystemCoreWebFonts() 248 { 249 NSArray *coreWebFontNames = @[ 250 @"Andale Mono", 251 @"Arial", 252 @"Arial Black", 253 @"Comic Sans MS", 254 @"Courier New", 255 @"Georgia", 256 @"Impact", 257 @"Times New Roman", 258 @"Trebuchet MS", 259 @"Verdana", 260 @"Webdings" 261 ]; 262 263 NSArray *fontFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:[NSURL fileURLWithPath:@"/Library/Fonts" isDirectory:YES] 264 includingPropertiesForKeys:@[NSURLFileResourceTypeKey, NSURLNameKey] options:0 error:0]; 265 266 for (NSURL *fontURL in fontFiles) { 267 NSString *resourceType; 268 NSString *fileName; 269 if (![fontURL getResourceValue:&resourceType forKey:NSURLFileResourceTypeKey error:0] 270 || ![fontURL getResourceValue:&fileName forKey:NSURLNameKey error:0]) 271 continue; 272 if (![resourceType isEqualToString:NSURLFileResourceTypeRegular]) 273 continue; 274 275 // Activate all font variations, such as Arial Bold Italic.ttf. This algorithm is not 100% precise, as it 276 // also activates e.g. Arial Unicode, which is not a variation of Arial. 277 for (NSString *coreWebFontName in coreWebFontNames) { 278 if ([fileName hasPrefix:coreWebFontName]) { 279 CTFontManagerRegisterFontsForURL((CFURLRef)fontURL, kCTFontManagerScopeProcess, 0); 280 break; 281 } 282 } 283 } 284 } 285 244 286 #endif // USE(APPKIT) 245 287 … … 277 319 #if USE(APPKIT) 278 320 swizzleNSFontManagerMethods(); 321 activateSystemCoreWebFonts(); 279 322 #endif // USE(APPKIT) 280 323 }
Note:
See TracChangeset
for help on using the changeset viewer.