| Index: Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
|
| diff --git a/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp b/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
|
| index 2cd0c869662481d1870770c7feb5ecbbcc366143..fa64ff9ec2bfcc945b7c0d4875089821cfb402eb 100644
|
| --- a/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
|
| +++ b/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
|
| @@ -171,39 +171,29 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
|
|
|
| SkTypeface* typeface = 0;
|
| FontPlatformData* result = 0;
|
| - FallbackScripts fallbackScript = SkGetFallbackScriptFromID(name);
|
| - if (SkTypeface_ValidScript(fallbackScript)) {
|
| - typeface = SkCreateTypefaceForScript(fallbackScript);
|
| - if (typeface)
|
| - result = new FontPlatformData(typeface, name, fontDescription.computedSize(),
|
| - (style & SkTypeface::kBold) && !typeface->isBold(),
|
| - (style & SkTypeface::kItalic) && !typeface->isItalic(),
|
| - fontDescription.orientation());
|
| - } else {
|
| - typeface = SkTypeface::CreateFromName(name, SkTypeface::kNormal);
|
| -
|
| - // CreateFromName always returns a typeface, falling back to a default font
|
| - // if the one requested could not be found. Calling Equal() with a null
|
| - // pointer will compare the returned font against the default, with the
|
| - // caveat that the default is always of normal style. When that happens,
|
| - // ignore the default font and allow WebCore to provide the next font on the
|
| - // CSS fallback list. The only exception to this occurs when the family name
|
| - // is a commonly used generic family, which is the case when called by
|
| - // getSimilarFontPlatformData() or getLastResortFallbackFont(). In that case
|
| - // the default font is an acceptable result.
|
| -
|
| - if (!SkTypeface::Equal(typeface, 0) || isFallbackFamily(family.string())) {
|
| - // We had to use normal styling to see if this was a default font. If
|
| - // we need bold or italic, replace with the corrected typeface.
|
| - if (style != SkTypeface::kNormal) {
|
| - typeface->unref();
|
| - typeface = SkTypeface::CreateFromName(name, static_cast<SkTypeface::Style>(style));
|
| - }
|
| - result = new FontPlatformData(typeface, name, fontDescription.computedSize(),
|
| - (style & SkTypeface::kBold) && !typeface->isBold(),
|
| - (style & SkTypeface::kItalic) && !typeface->isItalic(),
|
| - fontDescription.orientation());
|
| + typeface = SkTypeface::CreateFromName(name, SkTypeface::kNormal);
|
| +
|
| + // CreateFromName always returns a typeface, falling back to a default font
|
| + // if the one requested could not be found. Calling Equal() with a null
|
| + // pointer will compare the returned font against the default, with the
|
| + // caveat that the default is always of normal style. When that happens,
|
| + // ignore the default font and allow WebCore to provide the next font on the
|
| + // CSS fallback list. The only exception to this occurs when the family name
|
| + // is a commonly used generic family, which is the case when called by
|
| + // getSimilarFontPlatformData() or getLastResortFallbackFont(). In that case
|
| + // the default font is an acceptable result.
|
| +
|
| + if (!SkTypeface::Equal(typeface, 0) || isFallbackFamily(family.string())) {
|
| + // We had to use normal styling to see if this was a default font. If
|
| + // we need bold or italic, replace with the corrected typeface.
|
| + if (style != SkTypeface::kNormal) {
|
| + typeface->unref();
|
| + typeface = SkTypeface::CreateFromName(name, static_cast<SkTypeface::Style>(style));
|
| }
|
| + result = new FontPlatformData(typeface, name, fontDescription.computedSize(),
|
| + (style & SkTypeface::kBold) && !typeface->isBold(),
|
| + (style & SkTypeface::kItalic) && !typeface->isItalic(),
|
| + fontDescription.orientation());
|
| }
|
|
|
| SkSafeUnref(typeface);
|
|
|