| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 #include "platform/Language.h" | 33 #include "platform/Language.h" |
| 34 #include "platform/fonts/SimpleFontData.h" | 34 #include "platform/fonts/SimpleFontData.h" |
| 35 #include "platform/fonts/FontDescription.h" | 35 #include "platform/fonts/FontDescription.h" |
| 36 #include "platform/fonts/FontFaceCreationParams.h" | 36 #include "platform/fonts/FontFaceCreationParams.h" |
| 37 #include "third_party/skia/include/core/SkTypeface.h" | 37 #include "third_party/skia/include/core/SkTypeface.h" |
| 38 #include "third_party/skia/include/ports/SkFontMgr.h" | 38 #include "third_party/skia/include/ports/SkFontMgr.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 // static |
| 43 const AtomicString& FontCache::systemFontFamily(float) { |
| 44 return FontFamilyNames::system_ui; |
| 45 } |
| 46 |
| 42 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter( | 47 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter( |
| 43 const FontDescription& fontDescription, | 48 const FontDescription& fontDescription, |
| 44 UChar32 c, | 49 UChar32 c, |
| 45 const SimpleFontData*, | 50 const SimpleFontData*, |
| 46 FontFallbackPriority fallbackPriority) { | 51 FontFallbackPriority fallbackPriority) { |
| 47 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); | 52 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); |
| 48 AtomicString familyName = | 53 AtomicString familyName = |
| 49 getFamilyNameForCharacter(fm.get(), c, fontDescription, fallbackPriority); | 54 getFamilyNameForCharacter(fm.get(), c, fontDescription, fallbackPriority); |
| 50 if (familyName.isEmpty()) | 55 if (familyName.isEmpty()) |
| 51 return getLastResortFallbackFont(fontDescription, DoNotRetain); | 56 return getLastResortFallbackFont(fontDescription, DoNotRetain); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // For other scripts, use the default generic family mapping logic. | 95 // For other scripts, use the default generic family mapping logic. |
| 91 return familyName; | 96 return familyName; |
| 92 } | 97 } |
| 93 | 98 |
| 94 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); | 99 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); |
| 95 return getFamilyNameForCharacter(fm.get(), examplerChar, fontDescription, | 100 return getFamilyNameForCharacter(fm.get(), examplerChar, fontDescription, |
| 96 FontFallbackPriority::Text); | 101 FontFallbackPriority::Text); |
| 97 } | 102 } |
| 98 | 103 |
| 99 } // namespace blink | 104 } // namespace blink |
| OLD | NEW |