From ef9bb3c3ea3aa08071ea0c32a505b379c322e5b5 Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Mon, 17 Oct 2011 11:06:46 -0700 Subject: Fix bug #5438102 Double Arabic harakat overlap instead of stack In TextView IMPORTANT: this change needs two patches for Harfbuzz: - one concerning hb_utf16_script_run_prev() which was not returning the correct "previous" script - one for the "script_properties" table that was missing Arabic code point ranges and declaring HB_Script_Inherited instead of HB_Script_Arabic The current change is doing the following: - pass the correct typeface for Harbuzz shaping (depending on the script of the run) - offset correctly the glyphIDs returned by Harfbuzz We need to offset the glyphsID as Harfbuzz will return local glyphIDs (meaning in the local range of the font used for shapping). We then cannot use those glyphIDs when we are using a fallback Font (Arabic, Hebrews...) because the FontRenderer needs glyphIDs in the range of all the Fonts (including the fallbacks) Change-Id: I494897435bbc59293b02392ee2059cebcdf0e571 --- libs/hwui/OpenGLRenderer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index ce424ac341d1..70f1b7a4cc3d 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -2097,6 +2097,9 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, } FontRenderer& fontRenderer = mCaches.fontRenderer.getFontRenderer(paint); +#if DEBUG_GLYPHS + LOGD("OpenGLRenderer drawText() with FontID=%d", SkTypeface::UniqueID(paint->getTypeface())); +#endif fontRenderer.setFont(paint, SkTypeface::UniqueID(paint->getTypeface()), paint->getTextSize()); -- cgit v1.2.3-59-g8ed1b