mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 14:44:57 +00:00
make_unicode: Store the full BiDi direction type in the table.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2f6918cbe2
commit
d68f8d7b35
|
@ -162,56 +162,14 @@ static inline void dump_types(const char* header, WORD *types, int start, int en
|
|||
/* Convert the libwine information to the direction enum */
|
||||
static void classify(const WCHAR *string, WORD *chartype, DWORD count, const SCRIPT_CONTROL *c)
|
||||
{
|
||||
static const enum directions dir_map[16] =
|
||||
{
|
||||
L, /* unassigned defaults to L */
|
||||
L,
|
||||
R,
|
||||
EN,
|
||||
ES,
|
||||
ET,
|
||||
AN,
|
||||
CS,
|
||||
B,
|
||||
S,
|
||||
WS,
|
||||
ON,
|
||||
AL,
|
||||
NSM,
|
||||
BN,
|
||||
PDF /* also LRE, LRO, RLE, RLO */
|
||||
};
|
||||
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
chartype[i] = dir_map[get_table_entry( bidi_direction_table, string[i] )];
|
||||
switch (chartype[i])
|
||||
chartype[i] = get_table_entry( bidi_direction_table, string[i] );
|
||||
if (c->fLegacyBidiClass && chartype[i] == ES)
|
||||
{
|
||||
case ES:
|
||||
if (!c->fLegacyBidiClass) break;
|
||||
switch (string[i])
|
||||
{
|
||||
case '-':
|
||||
case '+': chartype[i] = NI; break;
|
||||
case '/': chartype[i] = CS; break;
|
||||
}
|
||||
break;
|
||||
case PDF:
|
||||
switch (string[i])
|
||||
{
|
||||
case 0x202A: chartype[i] = LRE; break;
|
||||
case 0x202B: chartype[i] = RLE; break;
|
||||
case 0x202C: chartype[i] = PDF; break;
|
||||
case 0x202D: chartype[i] = LRO; break;
|
||||
case 0x202E: chartype[i] = RLO; break;
|
||||
case 0x2066: chartype[i] = LRI; break;
|
||||
case 0x2067: chartype[i] = RLI; break;
|
||||
case 0x2068: chartype[i] = FSI; break;
|
||||
case 0x2069: chartype[i] = PDI; break;
|
||||
}
|
||||
break;
|
||||
if (string[i] == '+' || string[i] == '-') chartype[i] = NI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -363,6 +363,33 @@ my %c2_types =
|
|||
"PDI" => 11 # C2_OTHERNEUTRAL
|
||||
);
|
||||
|
||||
my %bidi_types =
|
||||
(
|
||||
"ON" => 0, # Other Neutrals
|
||||
"L" => 1, # Left-to-Right
|
||||
"R" => 2, # Right-to-Left
|
||||
"AN" => 3, # Arabic Number
|
||||
"EN" => 4, # European Number
|
||||
"AL" => 5, # Right-to-Left Arabic
|
||||
"NSM" => 6, # Non-Spacing Mark
|
||||
"CS" => 7, # Common Number Separator
|
||||
"ES" => 8, # European Number Separator
|
||||
"ET" => 9, # European Number Terminator
|
||||
"BN" => 10, # Boundary Neutral
|
||||
"S" => 11, # Segment Separator
|
||||
"WS" => 12, # Whitespace
|
||||
"B" => 13, # Paragraph Separator
|
||||
"RLO" => 14, # Right-to-Left Override
|
||||
"RLE" => 15, # Right-to-Left Embedding
|
||||
"LRO" => 16, # Left-to-Right Override
|
||||
"LRE" => 17, # Left-to-Right Embedding
|
||||
"PDF" => 18, # Pop Directional Format
|
||||
"LRI" => 19, # Left-to-Right Isolate
|
||||
"RLI" => 20, # Right-to-Left Isolate
|
||||
"FSI" => 21, # First Strong Isolate
|
||||
"PDI" => 22 # Pop Directional Isolate
|
||||
);
|
||||
|
||||
my %joining_types =
|
||||
(
|
||||
"U" => 0, # Non_Joining
|
||||
|
@ -2246,10 +2273,11 @@ sub dump_bidi_dir_table($)
|
|||
|
||||
for (my $i = 0; $i < 65536; $i++)
|
||||
{
|
||||
$table[$i] = $directions{$direction_table[$i]} if defined $direction_table[$i];
|
||||
$table[$i] = $bidi_types{$direction_table[$i]} if defined $direction_table[$i];
|
||||
}
|
||||
|
||||
dump_two_level_mapping( "DECLSPEC_HIDDEN bidi_direction_table", 0, @table );
|
||||
dump_two_level_mapping( "DECLSPEC_HIDDEN bidi_direction_table",
|
||||
$bidi_types{"L"}, @table );
|
||||
|
||||
close OUTPUT;
|
||||
save_file($filename);
|
||||
|
|
Loading…
Reference in a new issue