aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclaireho <chinglanho@gmail.com>2011-12-13 17:08:55 -0800
committerclaireho <chinglanho@gmail.com>2011-12-14 18:17:55 -0800
commit5b51d0c851af1852ecc7562790cbbbee156c2c44 (patch)
tree86c59a53e1d650d070116482cc6ee28f169a6d22
parent11de741c46a0583ba50dd912158b5c41f929bd7b (diff)
downloadharfbuzz-5b51d0c851af1852ecc7562790cbbbee156c2c44.tar.gz
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
-rwxr-xr-xcontrib/harfbuzz-unicode.c3
-rwxr-xr-xsrc/harfbuzz-gpos.c3
-rwxr-xr-xsrc/harfbuzz-indic.cpp10
-rwxr-xr-xsrc/harfbuzz-thai.c2
-rwxr-xr-xsrc/harfbuzz-tibetan.c2
5 files changed, 7 insertions, 13 deletions
diff --git a/contrib/harfbuzz-unicode.c b/contrib/harfbuzz-unicode.c
index 6b4778c..432d5b0 100755
--- a/contrib/harfbuzz-unicode.c
+++ b/contrib/harfbuzz-unicode.c
@@ -167,9 +167,6 @@ hb_utf16_script_run_prev(unsigned *num_code_points, HB_ScriptItem *output,
const HB_Script script = code_point_to_script(cp);
if (script != current_script) {
- /* BEGIN android-changed
- The condition was not correct by doing "a == b == constant"
- END android-changed */
if (current_script == HB_Script_Inherited && init_script == HB_Script_Inherited) {
// If we started off as inherited, we take whatever we can find.
output->script = script;
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 },