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) { | |
drott
2016/10/12 11:01:59
When will you need the parameter? If Mac instantia
kojii
2016/10/12 11:14:52
I'm thinking to replace "system-ui" with ".SF NS T
drott
2016/10/13 07:59:34
So you're saying you would like to move the replac
kojii
2016/10/13 09:03:20
Yes, that way we can keep one SkTypeface/SimpleFon
drott
2016/10/13 12:36:13
Yes, sounds reasonable.
| |
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 |