Commit c848f42a authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent ecbfb5e1
...@@ -642,9 +642,9 @@ static inline struct dwrite_fontfallback_builder *impl_from_IDWriteFontFallbackB ...@@ -642,9 +642,9 @@ static inline struct dwrite_fontfallback_builder *impl_from_IDWriteFontFallbackB
return CONTAINING_RECORD(iface, struct dwrite_fontfallback_builder, IDWriteFontFallbackBuilder_iface); return CONTAINING_RECORD(iface, struct dwrite_fontfallback_builder, IDWriteFontFallbackBuilder_iface);
} }
static inline UINT16 get_char_script(WCHAR c) static inline UINT16 get_char_script(UINT32 c)
{ {
UINT16 script = get_table_entry(wine_scripts_table, c); UINT16 script = get_table_entry_32(wine_scripts_table, c);
return script == Script_Inherited ? Script_Unknown : script; return script == Script_Inherited ? Script_Unknown : script;
} }
...@@ -816,7 +816,7 @@ static inline void set_break_condition(UINT32 pos, enum BreakConditionLocation l ...@@ -816,7 +816,7 @@ static inline void set_break_condition(UINT32 pos, enum BreakConditionLocation l
BOOL lb_is_newline_char(WCHAR ch) BOOL lb_is_newline_char(WCHAR ch)
{ {
short c = get_table_entry(wine_linebreak_table, ch); short c = get_table_entry_16(wine_linebreak_table, ch);
return c == b_LF || c == b_NL || c == b_CR || c == b_BK; 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 ...@@ -834,7 +834,7 @@ static HRESULT analyze_linebreaks(const WCHAR *text, UINT32 count, DWRITE_LINE_B
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
break_class[i] = get_table_entry(wine_linebreak_table, text[i]); break_class[i] = get_table_entry_16(wine_linebreak_table, text[i]);
breakpoints[i].breakConditionBefore = DWRITE_BREAK_CONDITION_NEUTRAL; breakpoints[i].breakConditionBefore = DWRITE_BREAK_CONDITION_NEUTRAL;
breakpoints[i].breakConditionAfter = DWRITE_BREAK_CONDITION_NEUTRAL; breakpoints[i].breakConditionAfter = DWRITE_BREAK_CONDITION_NEUTRAL;
......
...@@ -155,7 +155,7 @@ static void bidi_classify(const WCHAR *string, UINT8 *chartype, UINT32 count) ...@@ -155,7 +155,7 @@ static void bidi_classify(const WCHAR *string, UINT8 *chartype, UINT32 count)
UINT32 i; UINT32 i;
for (i = 0; i < count; ++i) 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] );
} }
/* RESOLVE EXPLICIT */ /* RESOLVE EXPLICIT */
...@@ -637,7 +637,7 @@ static BracketPair *bidi_compute_bracket_pairs(IsolatedRun *iso_run) ...@@ -637,7 +637,7 @@ static BracketPair *bidi_compute_bracket_pairs(IsolatedRun *iso_run)
stack_index = malloc(sizeof(int) * iso_run->length); stack_index = malloc(sizeof(int) * iso_run->length);
for (i = 0; i < iso_run->length; i++) { 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) if (ubv)
{ {
if (!out) if (!out)
......
...@@ -98,11 +98,16 @@ static inline const char *debugstr_tag(DWORD tag) ...@@ -98,11 +98,16 @@ static inline const char *debugstr_tag(DWORD tag)
const char *debugstr_sa_script(UINT16) DECLSPEC_HIDDEN; const char *debugstr_sa_script(UINT16) DECLSPEC_HIDDEN;
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)]; 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)];
}
static inline BOOL is_simulation_valid(DWRITE_FONT_SIMULATIONS simulations) static inline BOOL is_simulation_valid(DWRITE_FONT_SIMULATIONS simulations)
{ {
return (simulations & ~(DWRITE_FONT_SIMULATIONS_NONE | DWRITE_FONT_SIMULATIONS_BOLD | return (simulations & ~(DWRITE_FONT_SIMULATIONS_NONE | DWRITE_FONT_SIMULATIONS_BOLD |
......
...@@ -5941,7 +5941,7 @@ static unsigned int unicode_get_mirrored_char(unsigned int codepoint) ...@@ -5941,7 +5941,7 @@ static unsigned int unicode_get_mirrored_char(unsigned int codepoint)
WCHAR mirror; WCHAR mirror;
/* TODO: check if mirroring for higher planes makes sense at all */ /* TODO: check if mirroring for higher planes makes sense at all */
if (codepoint > 0xffff) return codepoint; if (codepoint > 0xffff) return codepoint;
mirror = get_table_entry(wine_mirror_map, codepoint); mirror = get_table_entry_16(wine_mirror_map, codepoint);
return mirror ? mirror : codepoint; return mirror ? mirror : codepoint;
} }
......
...@@ -2993,7 +2993,7 @@ sub dump_scripts($) ...@@ -2993,7 +2993,7 @@ sub dump_scripts($)
print OUTPUT "/* DO NOT EDIT!! */\n\n"; print OUTPUT "/* DO NOT EDIT!! */\n\n";
print OUTPUT "#include \"windef.h\"\n\n"; print OUTPUT "#include \"windef.h\"\n\n";
dump_two_level_mapping( "wine_scripts_table", 0, 16, @scripts_table ); dump_three_level_mapping( "wine_scripts_table", 0, 16, @scripts_table );
close OUTPUT; close OUTPUT;
save_file($filename); save_file($filename);
} }
...@@ -3257,7 +3257,7 @@ sub compress_array($$@) ...@@ -3257,7 +3257,7 @@ sub compress_array($$@)
} }
################################################################ ################################################################
# dump a char -> 16-bit value mapping table using two-level tables # dump a char -> value mapping table using two-level tables
sub dump_two_level_mapping($$$@) sub dump_two_level_mapping($$$@)
{ {
my $name = shift; my $name = shift;
......
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