| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 3 * Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. |
| 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 are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 // This function is called on android or when we are emulating android fonts on | 78 // This function is called on android or when we are emulating android fonts on |
| 79 // linux and the embedder has overriden the default fontManager with | 79 // linux and the embedder has overriden the default fontManager with |
| 80 // WebFontRendering::setSkiaFontMgr. | 80 // WebFontRendering::setSkiaFontMgr. |
| 81 // static | 81 // static |
| 82 AtomicString FontCache::GetFamilyNameForCharacter( | 82 AtomicString FontCache::GetFamilyNameForCharacter( |
| 83 SkFontMgr* fm, | 83 SkFontMgr* fm, |
| 84 UChar32 c, | 84 UChar32 c, |
| 85 const FontDescription& font_description, | 85 const FontDescription& font_description, |
| 86 FontFallbackPriority fallback_priority) { | 86 FontFallbackPriority fallback_priority) { |
| 87 ASSERT(fm); | 87 DCHECK(fm); |
| 88 | 88 |
| 89 const size_t kMaxLocales = 4; | 89 const size_t kMaxLocales = 4; |
| 90 const char* bcp47_locales[kMaxLocales]; | 90 const char* bcp47_locales[kMaxLocales]; |
| 91 size_t locale_count = 0; | 91 size_t locale_count = 0; |
| 92 | 92 |
| 93 // Fill in the list of locales in the reverse priority order. | 93 // Fill in the list of locales in the reverse priority order. |
| 94 // Skia expects the highest array index to be the first priority. | 94 // Skia expects the highest array index to be the first priority. |
| 95 const LayoutLocale* content_locale = font_description.Locale(); | 95 const LayoutLocale* content_locale = font_description.Locale(); |
| 96 if (const LayoutLocale* han_locale = | 96 if (const LayoutLocale* han_locale = |
| 97 LayoutLocale::LocaleForHan(content_locale)) | 97 LayoutLocale::LocaleForHan(content_locale)) |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (!font_platform_data) { | 204 if (!font_platform_data) { |
| 205 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, | 205 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, |
| 206 couriernew_creation_params, | 206 couriernew_creation_params, |
| 207 (AtomicString("Courier New"))); | 207 (AtomicString("Courier New"))); |
| 208 font_platform_data = | 208 font_platform_data = |
| 209 GetFontPlatformData(description, couriernew_creation_params, | 209 GetFontPlatformData(description, couriernew_creation_params, |
| 210 AlternateFontName::kLastResort); | 210 AlternateFontName::kLastResort); |
| 211 } | 211 } |
| 212 #endif | 212 #endif |
| 213 | 213 |
| 214 ASSERT(font_platform_data); | 214 DCHECK(font_platform_data); |
| 215 return FontDataFromFontPlatformData(font_platform_data, should_retain); | 215 return FontDataFromFontPlatformData(font_platform_data, should_retain); |
| 216 } | 216 } |
| 217 | 217 |
| 218 sk_sp<SkTypeface> FontCache::CreateTypeface( | 218 sk_sp<SkTypeface> FontCache::CreateTypeface( |
| 219 const FontDescription& font_description, | 219 const FontDescription& font_description, |
| 220 const FontFaceCreationParams& creation_params, | 220 const FontFaceCreationParams& creation_params, |
| 221 CString& name) { | 221 CString& name) { |
| 222 #if !OS(WIN) && !OS(ANDROID) | 222 #if !OS(WIN) && !OS(ANDROID) |
| 223 if (creation_params.CreationType() == kCreateFontByFciIdAndTtcIndex) { | 223 if (creation_params.CreationType() == kCreateFontByFciIdAndTtcIndex) { |
| 224 if (Platform::Current()->GetSandboxSupport()) | 224 if (Platform::Current()->GetSandboxSupport()) |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 font_description.IsSyntheticBold(), | 285 font_description.IsSyntheticBold(), |
| 286 ((font_description.Style() == kFontStyleItalic || | 286 ((font_description.Style() == kFontStyleItalic || |
| 287 font_description.Style() == kFontStyleOblique) && | 287 font_description.Style() == kFontStyleOblique) && |
| 288 !tf->isItalic()) || | 288 !tf->isItalic()) || |
| 289 font_description.IsSyntheticItalic(), | 289 font_description.IsSyntheticItalic(), |
| 290 font_description.Orientation())); | 290 font_description.Orientation())); |
| 291 } | 291 } |
| 292 #endif // !OS(WIN) | 292 #endif // !OS(WIN) |
| 293 | 293 |
| 294 } // namespace blink | 294 } // namespace blink |
| OLD | NEW |