Skip to content

Commit

Permalink
Update inheritedglyphs.py
Browse files Browse the repository at this point in the history
Fix a bug when IVS and alternates are encountered.
  • Loading branch information
haydenwong7bm committed May 3, 2023
1 parent 85da72e commit d34374c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inheritedglyphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def read_tsv(path):
IVS_AJ1_TABLE = read_tsv('conversion-tables/ivs-adobe-japan1.txt')
IVS_MJ_TABLE = read_tsv('conversion-tables/ivs-moji-joho.txt')

def convert(string: str, *, supp_planes='c', compatibility=[J, K, T], convert_not_unifiable=True, alternate=False, ivs=False, punctation_align_center=False) -> str:
def convert(string: str, *, supp_planes=CORE, compatibility=[J, K, T], convert_not_unifiable=True, alternate=False, ivs=False, punctation_align_center=False) -> str:
if not supp_planes:
supp_planes = ''

Expand Down Expand Up @@ -161,7 +161,7 @@ def convert(string: str, *, supp_planes='c', compatibility=[J, K, T], convert_no
if not alternate and replace_alternate:
char, value = value, char

if ord(char) <= 0xffff and ord(value) > 0xffff:
if ord(char[0]) <= 0xffff and ord(value[0]) > 0xffff:
replace = bool(supp_planes)
if supp_planes == CORE:
replace = value in SUPP_CORE_LIST
Expand Down

0 comments on commit d34374c

Please sign in to comment.