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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 inLanguage:(id)useNil; | 54 inLanguage:(id)useNil; |
55 + (NSFont*)findFontLike:(NSFont*)font | 55 + (NSFont*)findFontLike:(NSFont*)font |
56 forCharacter:(UniChar)uc | 56 forCharacter:(UniChar)uc |
57 inLanguage:(id)useNil; | 57 inLanguage:(id)useNil; |
58 @end | 58 @end |
59 | 59 |
60 namespace blink { | 60 namespace blink { |
61 | 61 |
62 const char* kColorEmojiFontMac = "Apple Color Emoji"; | 62 const char* kColorEmojiFontMac = "Apple Color Emoji"; |
63 | 63 |
| 64 // static |
| 65 const AtomicString& FontCache::legacySystemFontFamily() { |
| 66 DEFINE_STATIC_LOCAL(AtomicString, legacySystemFontFamily, |
| 67 ("BlinkMacSystemFont")); |
| 68 return legacySystemFontFamily; |
| 69 } |
| 70 |
| 71 // static |
| 72 const AtomicString& FontCache::systemFontFamily(float) { |
| 73 // TODO(kojii): Get the actual font name for the size. |
| 74 return FontFamilyNames::system_ui; |
| 75 } |
| 76 |
64 static void invalidateFontCache() { | 77 static void invalidateFontCache() { |
65 if (!isMainThread()) { | 78 if (!isMainThread()) { |
66 Platform::current()->mainThread()->getWebTaskRunner()->postTask( | 79 Platform::current()->mainThread()->getWebTaskRunner()->postTask( |
67 BLINK_FROM_HERE, WTF::bind(&invalidateFontCache)); | 80 BLINK_FROM_HERE, WTF::bind(&invalidateFontCache)); |
68 return; | 81 return; |
69 } | 82 } |
70 FontCache::fontCache()->invalidate(); | 83 FontCache::fontCache()->invalidate(); |
71 } | 84 } |
72 | 85 |
73 static void fontCacheRegisteredFontsChangedNotificationCallback( | 86 static void fontCacheRegisteredFontsChangedNotificationCallback( |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 std::unique_ptr<FontPlatformData> platformData = wrapUnique( | 290 std::unique_ptr<FontPlatformData> platformData = wrapUnique( |
278 new FontPlatformData(platformFont, size, syntheticBold, syntheticItalic, | 291 new FontPlatformData(platformFont, size, syntheticBold, syntheticItalic, |
279 fontDescription.orientation())); | 292 fontDescription.orientation())); |
280 if (!platformData->typeface()) { | 293 if (!platformData->typeface()) { |
281 return nullptr; | 294 return nullptr; |
282 } | 295 } |
283 return platformData; | 296 return platformData; |
284 } | 297 } |
285 | 298 |
286 } // namespace blink | 299 } // namespace blink |
OLD | NEW |