summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2013-05-09 18:04:39 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-09 18:04:39 +0000
commitdde8e539c3d76c98360e4cd1151cb15cba78a6b0 (patch)
tree8b77b96ce13d270758237b82ce4efc6ccad14385 /core/jni
parent73094fbc23a4f6142f790f63b66ae5b553fb6e55 (diff)
parentdd0a91294bc6b57c701bdb85b9e920207eeae55a (diff)
downloadframeworks_base-dde8e539c3d76c98360e4cd1151cb15cba78a6b0.zip
frameworks_base-dde8e539c3d76c98360e4cd1151cb15cba78a6b0.tar.gz
frameworks_base-dde8e539c3d76c98360e4cd1151cb15cba78a6b0.tar.bz2
Merge "Fix bug 8717690 Full-width Latin Letters Garbled on Tumblr App" into jb-mr2-dev
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android/graphics/TextLayoutCache.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index bcc1573..b2cf9c1 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -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);
}
}