Merge "Fix bug 8717690 Full-width Latin Letters Garbled on Tumblr App" into jb-mr2-dev

This commit is contained in:
Raph Levien
2013-05-09 18:04:39 +00:00
committed by Android (Google) Code Review

View File

@ -823,27 +823,26 @@ size_t TextLayoutShaper::shapeFontRun(const SkPaint* paint) {
baseGlyphCount = paint->getBaseGlyphCount(firstUnichar);
}
SkTypeface* scriptTypeface = NULL;
if (baseGlyphCount != 0) {
SkTypeface::Style style = SkTypeface::kNormal;
if (typeface != NULL) {
style = typeface->style();
}
typeface = typefaceForScript(paint, typeface, hb_buffer_get_script(mBuffer));
if (!typeface) {
baseGlyphCount = 0;
typeface = SkFontHost::CreateTypeface(NULL, NULL, style);
scriptTypeface = typefaceForScript(paint, typeface,
hb_buffer_get_script(mBuffer));
#if DEBUG_GLYPHS
ALOGD("Using Default Typeface");
ALOGD("Using Default Typeface for script %c%c%c%c",
HB_UNTAG(hb_buffer_get_script(mBuffer)));
#endif
}
}
if (scriptTypeface) {
typeface = scriptTypeface;
} else {
if (!typeface) {
baseGlyphCount = 0;
if (typeface) {
SkSafeRef(typeface);
} else {
typeface = SkFontHost::CreateTypeface(NULL, NULL, SkTypeface::kNormal);
#if DEBUG_GLYPHS
ALOGD("Using Default Typeface (normal style)");
#endif
} else {
SkSafeRef(typeface);
}
}