[gen-ucd] Start adding script-order

This commit is contained in:
Behdad Esfahbod 2019-05-20 17:17:38 -04:00
parent 4a0eb066fd
commit be8de18867

View File

@ -2,7 +2,7 @@
from __future__ import print_function, division, absolute_import
import io, os.path, sys
import io, os.path, sys, re
if len (sys.argv) != 2:
print ("usage: ./gen-ucd ucdxml-file", file=sys.stderr)
@ -51,6 +51,18 @@ for _ in ('Cc', 'Cf', 'Cn', 'Co', 'Cs', 'Ll', 'Lm', 'Lo', 'Lt', 'Lu',
'Pi', 'Po', 'Ps', 'Sc', 'Sk', 'Sm', 'So', 'Zl', 'Zp', 'Zs',):
gc_order[_]
sc_order = packTab.AutoMapping()
sc_array = []
sc_re = re.compile(" (HB_SCRIPT_[_A-Z]*).*HB_TAG [(]'(.)','(.)','(.)','(.)'[)]")
for line in open('hb-common.h'):
m = sc_re.search (line)
if not m: continue
name = m.group(1)
tag = ''.join(m.group(i) for i in range(2, 6))
i = sc_order[tag]
assert i == len(sc_array)
sc_array.append(name)
DEFAULT = 1
COMPACT = 3
print()