Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 // Request for public API: rdar://13803570 | 49 // Request for public API: rdar://13803570 |
| 50 @interface NSFont (WebKitSPI) | 50 @interface NSFont (WebKitSPI) |
| 51 + (NSFont*)findFontLike:(NSFont*)font forString:(NSString*)string withRange:(NSR ange)range inLanguage:(id)useNil; | 51 + (NSFont*)findFontLike:(NSFont*)font forString:(NSString*)string withRange:(NSR ange)range inLanguage:(id)useNil; |
| 52 + (NSFont*)findFontLike:(NSFont*)font forCharacter:(UniChar)uc inLanguage:(id)us eNil; | 52 + (NSFont*)findFontLike:(NSFont*)font forCharacter:(UniChar)uc inLanguage:(id)us eNil; |
| 53 @end | 53 @end |
| 54 | 54 |
| 55 namespace blink { | 55 namespace blink { |
| 56 | 56 |
| 57 const char* kColorEmojiFontMac = "Apple Color Emoji"; | 57 const char* kColorEmojiFontMac = "Apple Color Emoji"; |
| 58 | 58 |
| 59 // static | |
| 60 const AtomicString& FontCache::systemFontFamily() | |
| 61 { | |
| 62 DEFINE_STATIC_LOCAL(AtomicString, systemFontFamilyName, ("system-ui")); | |
|
drott
2016/09/29 13:48:54
Does this work on all OS X versions?
| |
| 63 return systemFontFamilyName; | |
| 64 } | |
| 65 | |
| 59 static void invalidateFontCache() | 66 static void invalidateFontCache() |
| 60 { | 67 { |
| 61 if (!isMainThread()) { | 68 if (!isMainThread()) { |
| 62 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR OM_HERE, WTF::bind(&invalidateFontCache)); | 69 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR OM_HERE, WTF::bind(&invalidateFontCache)); |
| 63 return; | 70 return; |
| 64 } | 71 } |
| 65 FontCache::fontCache()->invalidate(); | 72 FontCache::fontCache()->invalidate(); |
| 66 } | 73 } |
| 67 | 74 |
| 68 static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCe nterRef, void* observer, CFStringRef name, const void *, CFDictionaryRef) | 75 static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCe nterRef, void* observer, CFStringRef name, const void *, CFDictionaryRef) |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 // When loading fails, we do not want to use the returned FontPlatformData s ince it will not have | 242 // When loading fails, we do not want to use the returned FontPlatformData s ince it will not have |
| 236 // a valid SkTypeface. | 243 // a valid SkTypeface. |
| 237 std::unique_ptr<FontPlatformData> platformData = wrapUnique(new FontPlatform Data(platformFont, size, syntheticBold, syntheticItalic, fontDescription.orienta tion())); | 244 std::unique_ptr<FontPlatformData> platformData = wrapUnique(new FontPlatform Data(platformFont, size, syntheticBold, syntheticItalic, fontDescription.orienta tion())); |
| 238 if (!platformData->typeface()) { | 245 if (!platformData->typeface()) { |
| 239 return nullptr; | 246 return nullptr; |
| 240 } | 247 } |
| 241 return platformData; | 248 return platformData; |
| 242 } | 249 } |
| 243 | 250 |
| 244 } // namespace blink | 251 } // namespace blink |
| OLD | NEW |