[khmer] Reuse OT_H for OT_Coeng

https://github.com/harfbuzz/harfbuzz/pull/3648#discussion_r894517417
This commit is contained in:
Behdad Esfahbod 2022-06-10 16:53:11 -06:00
parent eb2f2e318a
commit e1826c3714
3 changed files with 119 additions and 117 deletions

View File

@ -76,7 +76,7 @@ enum ot_category_t {
OT_VPst = 23, OT_VPst = 23,
/* Khmer. */ /* Khmer. */
OT_Coeng = 24, OT_Coeng = OT_H,
OT_Robatic = 25, OT_Robatic = 25,
OT_Xgroup = 26, OT_Xgroup = 26,
OT_Ygroup = 27, OT_Ygroup = 27,

View File

@ -50,7 +50,7 @@ enum khmer_syllable_type_t {
#line 52 "hb-ot-shaper-khmer-machine.hh" #line 52 "hb-ot-shaper-khmer-machine.hh"
#define khmer_syllable_machine_ex_C 1u #define khmer_syllable_machine_ex_C 1u
#define khmer_syllable_machine_ex_Coeng 24u #define khmer_syllable_machine_ex_Coeng 4u
#define khmer_syllable_machine_ex_DOTTEDCIRCLE 11u #define khmer_syllable_machine_ex_DOTTEDCIRCLE 11u
#define khmer_syllable_machine_ex_PLACEHOLDER 10u #define khmer_syllable_machine_ex_PLACEHOLDER 10u
#define khmer_syllable_machine_ex_Ra 15u #define khmer_syllable_machine_ex_Ra 15u
@ -68,28 +68,28 @@ enum khmer_syllable_type_t {
#line 70 "hb-ot-shaper-khmer-machine.hh" #line 70 "hb-ot-shaper-khmer-machine.hh"
static const unsigned char _khmer_syllable_machine_trans_keys[] = { static const unsigned char _khmer_syllable_machine_trans_keys[] = {
5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 15u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 15u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u,
5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 15u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 15u, 5u, 26u, 5u, 26u, 5u, 26u,
5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 27u, 5u, 27u, 5u, 27u, 5u, 27u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 27u, 4u, 27u, 1u, 15u, 4u, 27u,
5u, 27u, 27u, 27u, 5u, 27u, 5u, 27u, 5u, 27u, 1u, 15u, 5u, 26u, 5u, 27u, 27u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 1u, 15u, 4u, 27u,
5u, 27u, 5u, 27u, 27u, 27u, 5u, 27u, 5u, 27u, 1u, 15u, 5u, 27u, 5u, 27u, 4u, 27u, 27u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 5u, 26u,
0 0
}; };
static const char _khmer_syllable_machine_key_spans[] = { static const char _khmer_syllable_machine_key_spans[] = {
22, 22, 22, 22, 22, 15, 22, 22, 22, 22, 15, 22, 22, 22, 22, 22,
22, 22, 22, 22, 22, 22, 15, 22, 22, 22, 22, 22, 15, 22, 22, 22,
22, 22, 22, 22, 27, 23, 23, 23, 22, 22, 22, 22, 27, 24, 15, 24,
23, 1, 23, 23, 23, 15, 22, 23, 1, 24, 24, 24, 24, 24, 15, 24,
23, 23, 1, 23, 23, 15, 23, 23 24, 1, 24, 24, 24, 24, 24, 22
}; };
static const short _khmer_syllable_machine_index_offsets[] = { static const short _khmer_syllable_machine_index_offsets[] = {
0, 23, 46, 69, 92, 115, 131, 154, 0, 23, 46, 62, 85, 108, 131, 154,
177, 200, 223, 246, 269, 292, 315, 331, 177, 200, 223, 246, 269, 285, 308, 331,
354, 377, 400, 423, 446, 474, 498, 522, 354, 377, 400, 423, 446, 474, 499, 515,
546, 570, 572, 596, 620, 644, 660, 683, 540, 542, 567, 592, 617, 642, 667, 683,
707, 731, 755, 757, 781, 805, 821, 845 708, 733, 735, 760, 785, 810, 835, 860
}; };
static const char _khmer_syllable_machine_indicies[] = { static const char _khmer_syllable_machine_indicies[]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13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 15, 13,
13, 13, 13, 16, 17, 13, 14, 14,
18, 18, 18, 18, 18, 18, 18, 18,
18, 18, 18, 18, 18, 18, 18, 18,
18, 18, 18, 17, 18, 19, 19, 13,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 15, 13, 14, 14, 13, 13, 13, 19, 13, 14, 14, 13,
16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 13, 13, 13, 13, 13, 13,
16, 16, 16, 16, 16, 17, 16, 16, 13, 13, 13, 13, 15, 13, 13, 13,
16, 16, 16, 15, 16, 18, 18, 16, 13, 13, 17, 13, 20, 20, 13, 13,
16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 13, 13, 13, 13, 13, 13,
16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 13, 13, 13, 13, 13, 13,
16, 16, 17, 16, 19, 19, 16, 16, 13, 15, 13, 21, 21, 13, 13, 13,
16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 13, 13, 13, 13, 13, 13,
16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 13, 13, 13, 13, 13, 13,
16, 20, 16, 21, 21, 16, 16, 16, 22, 13, 23, 23, 13, 13, 13, 13,
16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 13, 13, 13, 13, 13, 13,
16, 21, 16, 22, 22, 16, 16, 16, 13, 15, 13, 13, 13, 13, 13, 24,
16, 16, 16, 16, 16, 16, 16, 16, 13, 23, 23, 13, 13, 13, 13, 13,
16, 16, 17, 16, 16, 16, 16, 16, 13, 13, 13, 13, 13, 13, 13, 13,
23, 16, 22, 22, 16, 16, 16, 16, 13, 13, 13, 13, 13, 13, 24, 13,
16, 16, 16, 16, 16, 16, 16, 16, 25, 25, 13, 13, 13, 13, 13, 13,
16, 16, 16, 16, 16, 16, 16, 23, 13, 13, 13, 13, 13, 13, 13, 15,
16, 24, 24, 16, 16, 16, 16, 16, 13, 13, 13, 13, 13, 26, 13, 25,
16, 16, 16, 16, 16, 16, 16, 16, 25, 13, 13, 13, 13, 13, 13, 13,
17, 16, 16, 16, 16, 16, 25, 16, 13, 13, 13, 13, 13, 13, 13, 13,
24, 24, 16, 16, 16, 16, 16, 16, 13, 13, 13, 13, 26, 13, 28, 28,
16, 16, 16, 16, 16, 16, 16, 16, 27, 29, 30, 30, 27, 27, 27, 3,
16, 16, 16, 16, 16, 25, 16, 14,
14, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 17, 16,
16, 16, 16, 26, 15, 16, 28, 28,
27, 27, 29, 29, 27, 27, 27, 3,
3, 27, 27, 27, 28, 27, 27, 27, 3, 27, 27, 27, 28, 27, 27, 27,
27, 17, 23, 25, 20, 30, 27, 15, 27, 15, 24, 26, 22, 27, 27, 17,
21, 27, 32, 32, 31, 31, 31, 31, 19, 27, 32, 33, 33, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 2, 10, 12, 7, 33, 3, 4, 31, 31, 2, 10, 12, 8, 31, 3,
8, 31, 34, 34, 31, 31, 31, 31, 4, 5, 31, 28, 28, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 2, 10, 12, 7, 35, 31, 4, 31, 28, 31, 34, 35, 35, 31, 31,
8, 31, 5, 5, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 7, 35, 31, 2, 31, 31, 31, 2, 10, 12, 8, 31,
8, 31, 6, 6, 31, 31, 31, 31, 31, 4, 5, 31, 5, 31, 34, 6,
6, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 35, 31, 7, 31, 8, 31, 31, 2, 5, 31, 34,
8, 31, 8, 31, 36, 36, 31, 31, 7, 7, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 2, 31, 31, 7, 35, 31, 31, 31, 31, 31, 8, 5, 31,
31, 10, 8, 31, 37, 37, 31, 31, 34, 36, 36, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 2, 10, 31, 7, 35, 2, 31, 31, 8, 31, 31, 10, 5,
31, 12, 8, 31, 34, 34, 31, 31, 31, 34, 37, 37, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 2, 10, 12, 7, 33, 31, 2, 10, 31, 8, 31, 31, 12,
31, 4, 8, 31, 28, 28, 31, 31, 5, 31, 32, 35, 35, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 28, 31, 14, 14, 38, 38, 31, 31, 2, 10, 12, 8, 31, 31,
4, 5, 31, 39, 39, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 17, 38, 38, 38, 38, 38, 39, 38, 29, 40, 40, 38, 38,
38, 15, 38, 40, 40, 39, 39, 39, 38, 38, 38, 38, 38, 38, 38, 38,
39, 39, 39, 39, 39, 39, 39, 39, 38, 38, 38, 15, 24, 26, 22, 38,
39, 39, 17, 23, 25, 20, 41, 39, 16, 17, 19, 38, 41, 42, 42, 38,
15, 21, 39, 18, 18, 39, 39, 39, 38, 38, 38, 38, 38, 38, 38, 38,
39, 39, 39, 39, 39, 39, 39, 39, 38, 38, 38, 38, 15, 24, 26, 22,
39, 39, 39, 39, 39, 20, 41, 39, 38, 38, 17, 19, 38, 19, 38, 41,
17, 21, 39, 19, 19, 39, 39, 39, 20, 20, 38, 38, 38, 38, 38, 38,
39, 39, 39, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 38, 38,
39, 39, 39, 39, 39, 39, 41, 39, 38, 38, 22, 38, 38, 15, 19, 38,
20, 21, 39, 21, 39, 42, 42, 39, 41, 21, 21, 38, 38, 38, 38, 38,
39, 39, 39, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 38, 38,
39, 39, 39, 39, 17, 39, 39, 20, 38, 38, 38, 38, 38, 38, 22, 19,
41, 39, 23, 21, 39, 43, 43, 39, 38, 41, 43, 43, 38, 38, 38, 38,
39, 39, 39, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 38, 38,
39, 39, 39, 39, 17, 23, 39, 20, 38, 15, 38, 38, 22, 38, 38, 24,
41, 39, 25, 21, 39, 44, 44, 39, 19, 38, 41, 44, 44, 38, 38, 38,
39, 39, 39, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 38, 38,
39, 39, 39, 44, 39, 45, 45, 39, 38, 38, 15, 24, 38, 22, 38, 38,
39, 39, 39, 39, 39, 39, 39, 39, 26, 19, 38, 29, 42, 42, 38, 38,
39, 39, 39, 39, 17, 23, 25, 20, 38, 38, 38, 38, 38, 38, 38, 38,
30, 26, 15, 21, 39, 40, 40, 39, 38, 38, 38, 15, 24, 26, 22, 38,
39, 39, 39, 39, 39, 39, 39, 39, 38, 17, 19, 38, 14, 14, 45, 45,
39, 39, 39, 39, 17, 23, 25, 20, 45, 45, 45, 45, 45, 45, 45, 45,
30, 39, 15, 21, 39, 0 45, 45, 45, 15, 45, 45, 45, 45,
45, 17, 45, 0
}; };
static const char _khmer_syllable_machine_trans_targs[] = { static const char _khmer_syllable_machine_trans_targs[] = {
20, 1, 23, 28, 22, 3, 4, 24, 20, 1, 25, 29, 23, 24, 4, 5,
25, 7, 26, 9, 27, 20, 10, 31, 26, 7, 27, 9, 28, 20, 11, 34,
20, 32, 12, 13, 33, 34, 16, 35, 38, 32, 20, 33, 14, 15, 35, 17,
18, 36, 39, 20, 21, 30, 37, 20, 36, 19, 37, 20, 21, 30, 39, 20,
0, 29, 2, 5, 6, 8, 20, 20, 22, 0, 2, 3, 6, 8, 20, 31,
11, 14, 15, 17, 38, 19 10, 12, 13, 16, 18, 20
}; };
static const char _khmer_syllable_machine_trans_actions[] = { static const char _khmer_syllable_machine_trans_actions[] = {
1, 0, 2, 2, 2, 0, 0, 2, 1, 0, 2, 2, 2, 0, 0, 0,
0, 0, 2, 0, 2, 3, 0, 4, 2, 0, 2, 0, 2, 3, 0, 2,
5, 2, 0, 0, 2, 0, 0, 2, 4, 4, 5, 0, 0, 0, 2, 0,
0, 2, 4, 8, 2, 9, 0, 10, 2, 0, 2, 8, 2, 0, 9, 10,
0, 0, 0, 0, 0, 0, 11, 12, 0, 0, 0, 0, 0, 0, 11, 4,
0, 0, 0, 0, 4, 0 0, 0, 0, 0, 0, 12
}; };
static const char _khmer_syllable_machine_to_state_actions[] = { static const char _khmer_syllable_machine_to_state_actions[] = {
@ -240,10 +242,10 @@ static const char _khmer_syllable_machine_from_state_actions[] = {
static const unsigned char _khmer_syllable_machine_eof_trans[] = { static const unsigned char _khmer_syllable_machine_eof_trans[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 14, 17, 17, 17, 17, 17, 1, 1, 14, 19, 14, 14, 14, 14,
17, 17, 17, 17, 0, 32, 32, 32, 14, 14, 14, 14, 0, 32, 32, 32,
32, 32, 32, 32, 32, 32, 39, 40, 32, 32, 32, 32, 32, 32, 39, 39,
40, 40, 40, 40, 40, 40, 40, 40 39, 39, 39, 39, 39, 39, 39, 46
}; };
static const int khmer_syllable_machine_start = 20; static const int khmer_syllable_machine_start = 20;
@ -276,7 +278,7 @@ find_syllables_khmer (hb_buffer_t *buffer)
int cs; int cs;
hb_glyph_info_t *info = buffer->info; hb_glyph_info_t *info = buffer->info;
#line 280 "hb-ot-shaper-khmer-machine.hh" #line 282 "hb-ot-shaper-khmer-machine.hh"
{ {
cs = khmer_syllable_machine_start; cs = khmer_syllable_machine_start;
ts = 0; ts = 0;
@ -292,7 +294,7 @@ find_syllables_khmer (hb_buffer_t *buffer)
unsigned int syllable_serial = 1; unsigned int syllable_serial = 1;
#line 296 "hb-ot-shaper-khmer-machine.hh" #line 298 "hb-ot-shaper-khmer-machine.hh"
{ {
int _slen; int _slen;
int _trans; int _trans;
@ -306,7 +308,7 @@ _resume:
#line 1 "NONE" #line 1 "NONE"
{ts = p;} {ts = p;}
break; break;
#line 310 "hb-ot-shaper-khmer-machine.hh" #line 312 "hb-ot-shaper-khmer-machine.hh"
} }
_keys = _khmer_syllable_machine_trans_keys + (cs<<1); _keys = _khmer_syllable_machine_trans_keys + (cs<<1);
@ -336,11 +338,11 @@ _eof_trans:
#line 96 "hb-ot-shaper-khmer-machine.rl" #line 96 "hb-ot-shaper-khmer-machine.rl"
{te = p;p--;{ found_syllable (khmer_consonant_syllable); }} {te = p;p--;{ found_syllable (khmer_consonant_syllable); }}
break; break;
case 12: case 11:
#line 97 "hb-ot-shaper-khmer-machine.rl" #line 97 "hb-ot-shaper-khmer-machine.rl"
{te = p;p--;{ found_syllable (khmer_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }} {te = p;p--;{ found_syllable (khmer_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }}
break; break;
case 11: case 12:
#line 98 "hb-ot-shaper-khmer-machine.rl" #line 98 "hb-ot-shaper-khmer-machine.rl"
{te = p;p--;{ found_syllable (khmer_non_khmer_cluster); }} {te = p;p--;{ found_syllable (khmer_non_khmer_cluster); }}
break; break;
@ -348,11 +350,11 @@ _eof_trans:
#line 96 "hb-ot-shaper-khmer-machine.rl" #line 96 "hb-ot-shaper-khmer-machine.rl"
{{p = ((te))-1;}{ found_syllable (khmer_consonant_syllable); }} {{p = ((te))-1;}{ found_syllable (khmer_consonant_syllable); }}
break; break;
case 5: case 3:
#line 97 "hb-ot-shaper-khmer-machine.rl" #line 97 "hb-ot-shaper-khmer-machine.rl"
{{p = ((te))-1;}{ found_syllable (khmer_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }} {{p = ((te))-1;}{ found_syllable (khmer_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }}
break; break;
case 3: case 5:
#line 1 "NONE" #line 1 "NONE"
{ switch( act ) { { switch( act ) {
case 2: case 2:
@ -376,7 +378,7 @@ _eof_trans:
#line 98 "hb-ot-shaper-khmer-machine.rl" #line 98 "hb-ot-shaper-khmer-machine.rl"
{act = 3;} {act = 3;}
break; break;
#line 380 "hb-ot-shaper-khmer-machine.hh" #line 382 "hb-ot-shaper-khmer-machine.hh"
} }
_again: _again:
@ -385,7 +387,7 @@ _again:
#line 1 "NONE" #line 1 "NONE"
{ts = 0;} {ts = 0;}
break; break;
#line 389 "hb-ot-shaper-khmer-machine.hh" #line 391 "hb-ot-shaper-khmer-machine.hh"
} }
if ( ++p != pe ) if ( ++p != pe )

View File

@ -70,7 +70,7 @@ export VBlw = 21;
export VPre = 22; export VPre = 22;
export VPst = 23; export VPst = 23;
export Coeng = 24; export Coeng = 4;
export Robatic = 25; export Robatic = 25;
export Xgroup = 26; export Xgroup = 26;
export Ygroup = 27; export Ygroup = 27;