Changeset 202538 in webkit
- Timestamp:
- Jun 27, 2016 9:04:48 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r202537 r202538 1 2016-06-27 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [macOS] Test gardening: Generic font families should not map to fonts which aren't installed 4 https://bugs.webkit.org/show_bug.cgi?id=159111 5 <rdar://problem/25807529> 6 7 Unreviewed. 8 9 Osaka-Mono does not come preinstalled on macOS Sierra. However, many Japanese users 10 will have the font installed. Before setting the generic font family, we should check 11 to see if the font is present. 12 13 * page/cocoa/SettingsCocoa.mm: 14 (WebCore::osakaMonoIsInstalled): 15 (WebCore::Settings::initializeDefaultFontFamilies): 16 1 17 2016-06-24 Ryosuke Niwa <rniwa@webkit.org> 2 18 -
trunk/Source/WebCore/page/cocoa/SettingsCocoa.mm
r200534 r202538 52 52 #if PLATFORM(MAC) 53 53 54 static bool osakaMonoIsInstalled() 55 { 56 int one = 1; 57 RetainPtr<CFNumberRef> yes = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &one)); 58 CFTypeRef keys[] = { kCTFontEnabledAttribute, kCTFontNameAttribute }; 59 CFTypeRef values[] = { yes.get(), CFSTR("Osaka-Mono") }; 60 RetainPtr<CFDictionaryRef> attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(values), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); 61 RetainPtr<CTFontDescriptorRef> descriptor = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get())); 62 RetainPtr<CFSetRef> mandatoryAttributes = adoptCF(CFSetCreate(kCFAllocatorDefault, keys, WTF_ARRAY_LENGTH(keys), &kCFTypeSetCallBacks)); 63 return adoptCF(CTFontDescriptorCreateMatchingFontDescriptor(descriptor.get(), mandatoryAttributes.get())); 64 } 65 54 66 void Settings::initializeDefaultFontFamilies() 55 67 { … … 65 77 66 78 setStandardFontFamily("Hiragino Mincho ProN", USCRIPT_KATAKANA_OR_HIRAGANA); 67 setFixedFontFamily( "Osaka-Mono", USCRIPT_KATAKANA_OR_HIRAGANA);79 setFixedFontFamily(osakaMonoIsInstalled() ? "Osaka-Mono" : "Hiragino Sans", USCRIPT_KATAKANA_OR_HIRAGANA); 68 80 setSerifFontFamily("Hiragino Mincho ProN", USCRIPT_KATAKANA_OR_HIRAGANA); 69 81 setSansSerifFontFamily("Hiragino Kaku Gothic ProN", USCRIPT_KATAKANA_OR_HIRAGANA);
Note: See TracChangeset
for help on using the changeset viewer.