Commit ba58338b authored by Alexandre Julliard's avatar Alexandre Julliard

unicode: Add data for high Unicode planes to the linebreak table.

parent c848f42a
......@@ -816,7 +816,7 @@ static inline void set_break_condition(UINT32 pos, enum BreakConditionLocation l
BOOL lb_is_newline_char(WCHAR ch)
{
short c = get_table_entry_16(wine_linebreak_table, ch);
short c = get_table_entry_32(wine_linebreak_table, ch);
return c == b_LF || c == b_NL || c == b_CR || c == b_BK;
}
......@@ -834,7 +834,7 @@ static HRESULT analyze_linebreaks(const WCHAR *text, UINT32 count, DWRITE_LINE_B
for (i = 0; i < count; i++)
{
break_class[i] = get_table_entry_16(wine_linebreak_table, text[i]);
break_class[i] = get_table_entry_32(wine_linebreak_table, text[i]);
breakpoints[i].breakConditionBefore = DWRITE_BREAK_CONDITION_NEUTRAL;
breakpoints[i].breakConditionAfter = DWRITE_BREAK_CONDITION_NEUTRAL;
......
......@@ -164,7 +164,7 @@ static void classify(const WCHAR *string, WORD *chartype, DWORD count, const SCR
for (i = 0; i < count; ++i)
{
chartype[i] = get_table_entry( bidi_direction_table, string[i] );
chartype[i] = get_table_entry_16( bidi_direction_table, string[i] );
if (c->fLegacyBidiClass && chartype[i] == ES)
{
if (string[i] == '+' || string[i] == '-') chartype[i] = NI;
......@@ -658,7 +658,7 @@ static BracketPair *computeBracketPairs(IsolatedRun *iso_run)
for (i = 0; i < iso_run->length; i++)
{
unsigned short ubv = get_table_entry(bidi_bracket_table, iso_run->item[i].ch);
unsigned short ubv = get_table_entry_16(bidi_bracket_table, iso_run->item[i].ch);
if (!ubv)
continue;
......
......@@ -87,7 +87,7 @@ void BREAK_line(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT
for (i = 0; i < count; i++)
{
break_class[i] = get_table_entry( wine_linebreak_table, chars[i] );
break_class[i] = get_table_entry_32( wine_linebreak_table, chars[i] );
break_before[i] = 0;
memset(&la[i],0,sizeof(SCRIPT_LOGATTR));
......
......@@ -1087,7 +1087,7 @@ static void ContextualShape_Arabic(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p
context_shape = heap_alloc(cChars * sizeof(*context_shape));
for (i = 0; i < cChars; i++)
context_type[i] = get_table_entry( wine_shaping_table, pwcChars[i] );
context_type[i] = get_table_entry_16( wine_shaping_table, pwcChars[i] );
for (i = 0; i < cChars; i++)
{
......@@ -1346,7 +1346,7 @@ static void ContextualShape_Syriac(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p
context_shape = heap_alloc(cChars * sizeof(*context_shape));
for (i = 0; i < cChars; i++)
context_type[i] = get_table_entry( wine_shaping_table, pwcChars[i] );
context_type[i] = get_table_entry_16( wine_shaping_table, pwcChars[i] );
for (i = 0; i < cChars; i++)
{
......@@ -2219,7 +2219,7 @@ static inline int unicode_lex(WCHAR c)
if (c == 0x200C) return lex_ZWNJ;
if (c == 0x00A0) return lex_NBSP;
type = get_table_entry( indic_syllabic_table, c );
type = get_table_entry_16( indic_syllabic_table, c );
if ((type & 0x00ff) != 0x0007) type = type & 0x00ff;
......
......@@ -856,7 +856,7 @@ static HRESULT init_script_cache(const HDC hdc, SCRIPT_CACHE *psc)
static WCHAR mirror_char( WCHAR ch )
{
extern const WCHAR wine_mirror_map[] DECLSPEC_HIDDEN;
WCHAR mirror = get_table_entry( wine_mirror_map, ch );
WCHAR mirror = get_table_entry_16( wine_mirror_map, ch );
return mirror ? mirror : ch;
}
......
......@@ -233,11 +233,16 @@ static inline BOOL is_consonant( int type )
return (type == lex_Ra || type == lex_Consonant);
}
static inline unsigned short get_table_entry( const unsigned short *table, WCHAR ch )
static inline unsigned short get_table_entry_16( const unsigned short *table, WCHAR ch )
{
return table[table[table[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0xf)];
}
static inline unsigned short get_table_entry_32( const unsigned short *table, UINT ch )
{
return table[table[table[table[ch >> 12] + ((ch >> 8) & 0x0f)] + ((ch >> 4) & 0x0f)] + (ch & 0xf)];
}
typedef int (*lexical_function)(WCHAR c);
typedef void (*reorder_function)(WCHAR *chars, IndicSyllable *syllable, lexical_function lex);
......
......@@ -2748,7 +2748,7 @@ sub dump_linebreak($)
print OUTPUT "/* DO NOT EDIT!! */\n\n";
print OUTPUT "#include \"windef.h\"\n\n";
dump_two_level_mapping( "wine_linebreak_table", $break_types{'XX'}, 16, @break_table );
dump_three_level_mapping( "wine_linebreak_table", $break_types{'XX'}, 16, @break_table );
close OUTPUT;
save_file($filename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment