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() |
| 44 { |
| 45 DEFINE_STATIC_LOCAL(AtomicString, systemFontFamilyName, ()); |
| 46 return systemFontFamilyName; |
| 47 } |
| 48 |
| 49 // static |
| 50 void FontCache::setSystemFontFamily(const char* familyName) |
| 51 { |
| 52 NOTREACHED(); |
| 53 } |
| 54 |
42 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip
tion& fontDescription, UChar32 c, const SimpleFontData*, FontFallbackPriority fa
llbackPriority) | 55 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip
tion& fontDescription, UChar32 c, const SimpleFontData*, FontFallbackPriority fa
llbackPriority) |
43 { | 56 { |
44 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); | 57 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); |
45 AtomicString familyName = getFamilyNameForCharacter(fm.get(), c, fontDescrip
tion, fallbackPriority); | 58 AtomicString familyName = getFamilyNameForCharacter(fm.get(), c, fontDescrip
tion, fallbackPriority); |
46 if (familyName.isEmpty()) | 59 if (familyName.isEmpty()) |
47 return getLastResortFallbackFont(fontDescription, DoNotRetain); | 60 return getLastResortFallbackFont(fontDescription, DoNotRetain); |
48 return fontDataFromFontPlatformData(getFontPlatformData(fontDescription, Fon
tFaceCreationParams(familyName)), DoNotRetain); | 61 return fontDataFromFontPlatformData(getFontPlatformData(fontDescription, Fon
tFaceCreationParams(familyName)), DoNotRetain); |
49 } | 62 } |
50 | 63 |
51 // static | 64 // static |
(...skipping 23 matching lines...) Expand all Loading... |
75 default: | 88 default: |
76 // For other scripts, use the default generic family mapping logic. | 89 // For other scripts, use the default generic family mapping logic. |
77 return familyName; | 90 return familyName; |
78 } | 91 } |
79 | 92 |
80 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); | 93 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); |
81 return getFamilyNameForCharacter(fm.get(), examplerChar, fontDescription, Fo
ntFallbackPriority::Text); | 94 return getFamilyNameForCharacter(fm.get(), examplerChar, fontDescription, Fo
ntFallbackPriority::Text); |
82 } | 95 } |
83 | 96 |
84 } // namespace blink | 97 } // namespace blink |
OLD | NEW |