From 677726b376402937f53ddb192dc97078b92b7c9e Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Tue, 8 Oct 2013 15:45:16 +0200 Subject: [PATCH] Implement language-specific GSUB processing This patch allows HarfBuzz to select language-specific features based on the language. It is a fix for bug 7004056. Change-Id: I63f01b9580250728b900f19f357cefdeb9d36c72 --- core/jni/android/graphics/TextLayoutCache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp index a0c50fae558d2..92d253f0458e6 100644 --- a/core/jni/android/graphics/TextLayoutCache.cpp +++ b/core/jni/android/graphics/TextLayoutCache.cpp @@ -721,7 +721,8 @@ void TextLayoutShaper::computeRunValues(const SkPaint* paint, const UChar* conte hb_buffer_set_direction(mBuffer, isRTL ? HB_DIRECTION_RTL : HB_DIRECTION_LTR); hb_buffer_set_script(mBuffer, run.script); - // Should set language here (for bug 7004056) + SkString langString = paint->getPaintOptionsAndroid().getLanguage().getTag(); + hb_buffer_set_language(mBuffer, hb_language_from_string(langString.c_str(), -1)); hb_buffer_add_utf16(mBuffer, contextChars, contextCount, start + run.pos, run.length); // Initialize Harfbuzz Shaper and get the base glyph count for offsetting the glyphIDs