Skip to content

Commit

Permalink
Merge pull request #3249 from harfbuzz/use-merge-s-o
Browse files Browse the repository at this point in the history
[USE] Merge the categories S and O
  • Loading branch information
behdad committed Oct 8, 2021
2 parents 8eaee2f + bb50aae commit cca42cd
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 252 deletions.
9 changes: 4 additions & 5 deletions src/gen-use-table.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def is_BASE_OTHER(U, UISC, UDI, UGC, AJT):
if UISC == Consonant_Placeholder: return True
return U in [0x2015, 0x2022, 0x25FB, 0x25FC, 0x25FD, 0x25FE]
def is_CGJ(U, UISC, UDI, UGC, AJT):
# Also includes VARIATION_SELECTOR, WJ, and ZWJ
return U == 0x200D or UDI and UGC in [Mc, Me, Mn]
def is_CONS_FINAL(U, UISC, UDI, UGC, AJT):
return ((UISC == Consonant_Final and UGC != Lo) or
Expand All @@ -269,6 +270,7 @@ def is_HALANT(U, UISC, UDI, UGC, AJT):
and not is_HALANT_OR_VOWEL_MODIFIER(U, UISC, UDI, UGC, AJT)
and not is_SAKOT(U, UISC, UDI, UGC, AJT))
def is_HALANT_OR_VOWEL_MODIFIER(U, UISC, UDI, UGC, AJT):
# Split off of HALANT
# https://github.com/harfbuzz/harfbuzz/issues/1102
# https://github.com/harfbuzz/harfbuzz/issues/1379
return U in [0x11046, 0x1134D]
Expand All @@ -285,20 +287,18 @@ def is_HIEROGLYPH_SEGMENT_END(U, UISC, UDI, UGC, AJT):
def is_ZWNJ(U, UISC, UDI, UGC, AJT):
return UISC == Non_Joiner
def is_OTHER(U, UISC, UDI, UGC, AJT):
# Also includes BASE_IND, Rsv, and SYM
return ((UGC in [Cn, Po] or UISC in [Consonant_Dead, Joiner, Modifying_Letter, Other])
and not is_BASE(U, UISC, UDI, UGC, AJT)
and not is_BASE_OTHER(U, UISC, UDI, UGC, AJT)
and not is_CGJ(U, UISC, UDI, UGC, AJT)
and not is_SYM(U, UISC, UDI, UGC, AJT)
and not is_SYM_MOD(U, UISC, UDI, UGC, AJT)
)
def is_REPHA(U, UISC, UDI, UGC, AJT):
return UISC in [Consonant_Preceding_Repha, Consonant_Prefixed]
def is_SAKOT(U, UISC, UDI, UGC, AJT):
# Split off of HALANT
return U == 0x1A60
def is_SYM(U, UISC, UDI, UGC, AJT):
if U in [0x25CC, 0x1E14F]: return False
return UGC in [So, Sc] and U not in [0x0F01, 0x1B62, 0x1B68]
def is_SYM_MOD(U, UISC, UDI, UGC, AJT):
return U in [0x1B6B, 0x1B6C, 0x1B6D, 0x1B6E, 0x1B6F, 0x1B70, 0x1B71, 0x1B72, 0x1B73]
def is_VOWEL(U, UISC, UDI, UGC, AJT):
Expand Down Expand Up @@ -331,7 +331,6 @@ def is_VOWEL_MOD(U, UISC, UDI, UGC, AJT):
'ZWNJ': is_ZWNJ,
'O': is_OTHER,
'R': is_REPHA,
'S': is_SYM,
'Sk': is_SAKOT,
'SM': is_SYM_MOD,
'V': is_VOWEL,
Expand Down

0 comments on commit cca42cd

Please sign in to comment.