From 5b51d0c851af1852ecc7562790cbbbee156c2c44 Mon Sep 17 00:00:00 2001 From: claireho Date: Tue, 13 Dec 2011 17:08:55 -0800 Subject: Syncup with upstream HarfbuzzOld. Bug5757588 Cherry-pick the fixes for locale specific bugs and a crash bug in harfbuzz-gpos.c. Current Android Harfbuzz(http://cgit.freedesktop.org/harfbuzz.old/) is based on SHA 5a381d21b924da0c0843940d223cd6fff767efdc(Sep. 09 2010). I cherry pick the following CLs: 93d8573ddcf97648983a1c1b5cdda8a3ec6d4432: For general complex scripts. Android has the fixes by Fabrice. ff0612c2e7df1b86fc702c72e3015a6a5ae39b4c: For Tibetan only. Included in this CL. Android does not support Tibetan, so it does not hurt to include the fixes. 81f2ecafa19b602f950df5a9e6e1b99c4b5ea55e: For Indic only. Android has the fixes by Jungshik/claire. 81c8ef785b079980ad5b46be4fe7c7bf156dbf65: For general. Included in this CL to prevent crash in gpos data processing. 213bd693a55c04ef25f5e8de5f6feefa9473a30a: For Hebrew only. Android has the fixes by Claire since HC release. 3af70a9936269e7af0e7847497292e28065dea28: For Thai only. Included in this CL. Change-Id: I4a3a8f8b3db504d59f0d042933c96645f0c23b58 --- src/harfbuzz-gpos.c | 3 +++ src/harfbuzz-indic.cpp | 10 ++-------- src/harfbuzz-thai.c | 2 +- src/harfbuzz-tibetan.c | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/harfbuzz-gpos.c b/src/harfbuzz-gpos.c index a216005..7bd3b3b 100755 --- a/src/harfbuzz-gpos.c +++ b/src/harfbuzz-gpos.c @@ -3012,6 +3012,9 @@ static HB_Error Lookup_MarkMarkPos( GPOS_Instance* gpi, j--; } + if ( i > buffer->in_pos ) + return HB_Err_Not_Covered; + error = _HB_OPEN_Coverage_Index( &mmp->Mark2Coverage, IN_GLYPH( j ), &mark2_index ); if ( error ) diff --git a/src/harfbuzz-indic.cpp b/src/harfbuzz-indic.cpp index 038160e..ffe9573 100755 --- a/src/harfbuzz-indic.cpp +++ b/src/harfbuzz-indic.cpp @@ -37,10 +37,7 @@ static HB_Bool isLetter(HB_UChar16 ucs) FLAG(HB_Letter_Titlecase) | FLAG(HB_Letter_Modifier) | FLAG(HB_Letter_Other); - // BEGIN android-changed - // Check the value is zero or not instead of casting int to HB_Bool(unsigned char). - return (FLAG(HB_GetUnicodeCharCategory(ucs)) & test) != 0; - // END android-changed + return !!(FLAG(HB_GetUnicodeCharCategory(ucs)) & test); } static HB_Bool isMark(HB_UChar16 ucs) @@ -48,10 +45,7 @@ static HB_Bool isMark(HB_UChar16 ucs) const int test = FLAG(HB_Mark_NonSpacing) | FLAG(HB_Mark_SpacingCombining) | FLAG(HB_Mark_Enclosing); - // BEGIN android-changed - // Check the value is zero or not instead of casting int to HB_Bool(unsigned char). - return (FLAG(HB_GetUnicodeCharCategory(ucs)) & test) != 0; - // END android-changed + return !!(FLAG(HB_GetUnicodeCharCategory(ucs)) & test); } enum Form { diff --git a/src/harfbuzz-thai.c b/src/harfbuzz-thai.c index e153ba9..e80e2c5 100755 --- a/src/harfbuzz-thai.c +++ b/src/harfbuzz-thai.c @@ -91,7 +91,7 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri for (i = 0; i < numbreaks; ++i) { if (break_positions[i] > 0) { attributes[break_positions[i]-1].lineBreakType = HB_Break; - attributes[i].wordBoundary = TRUE; + attributes[break_positions[i]-1].wordBoundary = TRUE; } } diff --git a/src/harfbuzz-tibetan.c b/src/harfbuzz-tibetan.c index bfa31b1..847ac52 100755 --- a/src/harfbuzz-tibetan.c +++ b/src/harfbuzz-tibetan.c @@ -90,7 +90,7 @@ static const unsigned char tibetanForm[0x80] = { #define tibetan_form(c) \ - (TibetanForm)tibetanForm[c - 0x0f40] + ((c) >= 0x0f40 && (c) <= 0x0fc0 ? (TibetanForm)tibetanForm[(c) - 0x0f40] : TibetanOther) static const HB_OpenTypeFeature tibetan_features[] = { { HB_MAKE_TAG('c', 'c', 'm', 'p'), CcmpProperty }, -- cgit v1.2.3