[use] Implement Consonant_With_Stacker

Related to https://github.com/behdad/harfbuzz/issues/528
This commit is contained in:
Behdad Esfahbod 2017-10-03 14:57:14 +02:00
parent 3ca9c92aa6
commit e07669fc43
4 changed files with 13 additions and 8 deletions

View File

@ -178,6 +178,8 @@ def is_CONS_MOD(U, UISC, UGC):
def is_CONS_SUB(U, UISC, UGC):
#SPEC-DRAFT return UISC == Consonant_Subjoined
return UISC == Consonant_Subjoined and UGC != Lo
def is_CONS_WITH_STACKER(U, UISC, UGC):
return UISC == Consonant_With_Stacker
def is_HALANT(U, UISC, UGC):
return UISC in [Virama, Invisible_Stacker]
def is_HALANT_NUM(U, UISC, UGC):
@ -199,9 +201,7 @@ def is_OTHER(U, UISC, UGC):
def is_Reserved(U, UISC, UGC):
return UGC == 'Cn'
def is_REPHA(U, UISC, UGC):
#return UISC == Consonant_Preceding_Repha
#SPEC-OUTDATED hack to categorize Consonant_With_Stacker and Consonant_Prefixed
return UISC in [Consonant_Preceding_Repha, Consonant_With_Stacker, Consonant_Prefixed]
return UISC in [Consonant_Preceding_Repha, Consonant_Prefixed]
def is_SYM(U, UISC, UGC):
if U == 0x25CC: return False #SPEC-DRAFT
#SPEC-DRAFT return UGC in [So, Sc] or UISC == Symbol_Letter
@ -230,6 +230,7 @@ use_mapping = {
'M': is_CONS_MED,
'CM': is_CONS_MOD,
'SUB': is_CONS_SUB,
'CS': is_CONS_WITH_STACKER,
'H': is_HALANT,
'HN': is_HALANT_NUM,
'ZWNJ': is_ZWNJ,

View File

@ -86,6 +86,7 @@ VMPst = 39; # VOWEL_MOD_POST
VMPre = 23; # VOWEL_MOD_PRE
SMAbv = 41; # SYM_MOD_ABOVE
SMBlw = 42; # SYM_MOD_BELOW
CS = 43; # CONS_WITH_STACKER
consonant_modifiers = CMAbv* CMBlw* ((H B | SUB) VS? CMAbv? CMBlw*)*;
@ -96,12 +97,12 @@ vowel_modifiers = VMPre* VMAbv* VMBlw* VMPst*;
final_consonants = FAbv* FBlw* FPst* FM?;
virama_terminated_cluster =
R? (B | GB) VS?
(R|CS)? (B | GB) VS?
consonant_modifiers
H
;
standard_cluster =
R? (B | GB) VS?
(R|CS)? (B | GB) VS?
consonant_modifiers
medial_consonants
dependent_vowels

View File

@ -87,7 +87,8 @@ enum use_category_t {
USE_VMPst = 39, /* VOWEL_MOD_POST */
USE_VMPre = 23, /* VOWEL_MOD_PRE */
USE_SMAbv = 41, /* SYM_MOD_ABOVE */
USE_SMBlw = 42 /* SYM_MOD_BELOW */
USE_SMBlw = 42, /* SYM_MOD_BELOW */
USE_CS = 43 /* CONS_WITH_STACKER */
};
HB_INTERNAL USE_TABLE_ELEMENT_TYPE

View File

@ -19,6 +19,7 @@
#define B USE_B /* BASE */
#define CGJ USE_CGJ /* CGJ */
#define CS USE_CS /* CONS_WITH_STACKER */
#define FM USE_FM /* CONS_FINAL_MOD */
#define GB USE_GB /* BASE_OTHER */
#define H USE_H /* HALANT */
@ -163,7 +164,7 @@ static const USE_TABLE_ELEMENT_TYPE use_table[] = {
/* 0CC0 */ VAbv, VPst, VPst, VPst, VPst, O, VAbv, VAbv, VAbv, O, VAbv, VAbv, VAbv, H, O, O,
/* 0CD0 */ O, O, O, O, O, VPst, VPst, O, O, O, O, O, O, O, B, O,
/* 0CE0 */ B, B, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B,
/* 0CF0 */ O, R, R, O, O, O, O, O, O, O, O, O, O, O, O, O,
/* 0CF0 */ O, CS, CS, O, O, O, O, O, O, O, O, O, O, O, O, O,
/* Malayalam */
@ -467,7 +468,7 @@ static const USE_TABLE_ELEMENT_TYPE use_table[] = {
/* Brahmi */
/* 11000 */ VMPst, VMAbv, VMPst, R, R, B, B, B, B, B, B, B, B, B, B, B,
/* 11000 */ VMPst, VMAbv, VMPst, CS, CS, B, B, B, B, B, B, B, B, B, B, B,
/* 11010 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
/* 11020 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
/* 11030 */ B, B, B, B, B, B, B, B, VAbv, VAbv, VAbv, VAbv, VBlw, VBlw, VBlw, VBlw,
@ -729,6 +730,7 @@ hb_use_get_categories (hb_codepoint_t u)
#undef B
#undef CGJ
#undef CS
#undef FM
#undef GB
#undef H