From 7fffdf202727ba502c4ab3e68db458eb3f0a64a4 Mon Sep 17 00:00:00 2001 From: Rashmi Shyamasundar Date: Fri, 7 Jun 2013 11:33:25 +0530 Subject: [PATCH] [Title] Fix the parsing-logic used to collect the harfBuzzRuns [Issue#] N_SE36590 [Problem] Width of any word, containing a complex character after a space, is wrong. [Cause] There should be one harfBuzzRun created for one word. In the case where the word starts with a complex character and there is a space before the word, the first glyph of the complex character becomes one harfBuzzRun and the rest of the word is another harfBuzzRun. The complex character is not reshaped as expected. [Solution] Fix the parsing-logic used to collect the harfBuzzRuns, in function HarfBuzzShaper::collectHarfBuzzRuns. Update the value of "nextScript" in the for-loop, soon after consuming each character. [Developer] rashmi.s2@samsung.com --- Source/WTF/wtf/Platform.h | 1 + Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index 8f463c5..ecc7352 100755 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -437,6 +437,7 @@ #define ENABLE_TIZEN_WRT_APP_URI_SCHEME 1 /*Sungman Kim(ssungmai.kim@samsung.com) : WRT app:// scheme support*/ #define ENABLE_TIZEN_SUPPORT_COMPLEX_FONTS_SHAPING 1 /* Hyeonji Kim(hyeonji.kim@samsung.com) : Support complex fonts shaping */ #define ENABLE_TIZEN_FALLBACK_FONTDATA 1 /* Hyeonji Kim(hyeonji.kim@samsung.com) : Add the fallback fontData to FontFallbackList */ +#define ENABLE_TIZEN_COLLECT_HARFBUZZRUN 1 /* Rashmi Shyamasundar(rashmi.s2@samsung.com) Create proper harfBuzzRun for a word which follows a space */ #define ENABLE_TIZEN_CONTEXTSHADOW_BLUR_NEON 0 /* use neon shadowblur function in ContextShadow.cpp */ #define ENABLE_TIZEN_ON_AUTHENTICATION_REQUESTED 1 /* Sungman Kim(ssungmai.kim@samsung.com) : Implement to requested authentication signal handling method */ diff --git a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp index cb31929..03611eb 100644 --- a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp +++ b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp @@ -249,9 +249,15 @@ bool HarfBuzzShaper::collectHarfBuzzRuns() for (iterator.advance(clusterLength); iterator.consume(character, clusterLength); iterator.advance(clusterLength)) { nextFontData = m_font->glyphDataForCharacter(character, false).fontData; +#if ENABLE(TIZEN_COLLECT_HARFBUZZRUN) + nextScript = uscript_getScript(character, &errorCode); + if (nextFontData != currentFontData) + break; +#else if (nextFontData != currentFontData) break; nextScript = uscript_getScript(character, &errorCode); +#endif if (U_FAILURE(errorCode)) return false; if ((currentScript != nextScript) && (currentScript != USCRIPT_INHERITED)) -- 2.7.4