Add ucd-table make target
This commit is contained in:
parent
040b261dee
commit
f1d20d9b4d
|
@ -253,31 +253,38 @@ GENERATORS = \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
EXTRA_DIST += $(GENERATORS)
|
EXTRA_DIST += $(GENERATORS)
|
||||||
|
|
||||||
unicode-tables: arabic-table indic-table tag-table use-table emoji-table
|
unicode-tables: \
|
||||||
|
arabic-table \
|
||||||
|
emoji-table \
|
||||||
|
indic-table \
|
||||||
|
tag-table \
|
||||||
|
ucd-table \
|
||||||
|
use-table \
|
||||||
|
emoji-table \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt
|
arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt
|
||||||
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-arabic-table.hh \
|
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-arabic-table.hh \
|
||||||
|| ($(RM) $(srcdir)/hb-ot-shape-complex-arabic-table.hh; false)
|
|| ($(RM) $(srcdir)/hb-ot-shape-complex-arabic-table.hh; false)
|
||||||
|
emoji-table: gen-emoji-table.py emoji-data.txt
|
||||||
|
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-unicode-emoji-table.hh \
|
||||||
|
|| ($(RM) $(srcdir)/hb-unicode-emoji-table.hh; false)
|
||||||
indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt
|
indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt
|
||||||
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-indic-table.cc \
|
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-indic-table.cc \
|
||||||
|| ($(RM) $(srcdir)/hb-ot-shape-complex-indic-table.cc; false)
|
|| ($(RM) $(srcdir)/hb-ot-shape-complex-indic-table.cc; false)
|
||||||
|
|
||||||
tag-table: gen-tag-table.py languagetags language-subtag-registry
|
tag-table: gen-tag-table.py languagetags language-subtag-registry
|
||||||
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-tag-table.hh \
|
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-tag-table.hh \
|
||||||
|| ($(RM) $(srcdir)/hb-ot-tag-table.hh; false)
|
|| ($(RM) $(srcdir)/hb-ot-tag-table.hh; false)
|
||||||
|
ucd-table: gen-ucd-table.py ucd.nounihan.grouped.zip hb-common.h
|
||||||
|
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ucd-table.hh \
|
||||||
|
|| ($(RM) $(srcdir)/hb-ucd-table.hh; false)
|
||||||
use-table: gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt
|
use-table: gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt
|
||||||
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-use-table.cc \
|
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-use-table.cc \
|
||||||
|| ($(RM) $(srcdir)/hb-ot-shape-complex-use-table.cc; false)
|
|| ($(RM) $(srcdir)/hb-ot-shape-complex-use-table.cc; false)
|
||||||
|
|
||||||
vowel-constraints: gen-vowel-constraints.py HBIndicVowelConstraints.txt Scripts.txt
|
vowel-constraints: gen-vowel-constraints.py HBIndicVowelConstraints.txt Scripts.txt
|
||||||
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc \
|
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc \
|
||||||
|| ($(RM) $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc; false)
|
|| ($(RM) $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc; false)
|
||||||
|
|
||||||
emoji-table: gen-emoji-table.py emoji-data.txt
|
|
||||||
$(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-unicode-emoji-table.hh \
|
|
||||||
|| ($(RM) $(srcdir)/hb-unicode-emoji-table.hh; false)
|
|
||||||
|
|
||||||
built-sources: $(BUILT_SOURCES)
|
built-sources: $(BUILT_SOURCES)
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ import io, os.path, sys, re
|
||||||
import logging
|
import logging
|
||||||
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
|
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
|
||||||
|
|
||||||
if len (sys.argv) != 2:
|
if len (sys.argv) not in (2, 3):
|
||||||
print("usage: ./gen-ucd-table ucd.nounihan.grouped.xml", file=sys.stderr)
|
print("usage: ./gen-ucd-table ucd.nounihan.grouped.xml [/path/to/hb-common.h]", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# https://github.com/harfbuzz/packtab
|
# https://github.com/harfbuzz/packtab
|
||||||
|
@ -18,6 +18,8 @@ logging.info('Loading UCDXML...')
|
||||||
ucdxml = packTab.ucdxml.load_ucdxml(sys.argv[1])
|
ucdxml = packTab.ucdxml.load_ucdxml(sys.argv[1])
|
||||||
ucd = packTab.ucdxml.ucdxml_get_repertoire(ucdxml)
|
ucd = packTab.ucdxml.ucdxml_get_repertoire(ucdxml)
|
||||||
|
|
||||||
|
hb_common_h = 'hb-common.h' if len (sys.argv) < 3 else sys.argv[2]
|
||||||
|
|
||||||
logging.info('Preparing data tables...')
|
logging.info('Preparing data tables...')
|
||||||
|
|
||||||
gc = [u['gc'] for u in ucd]
|
gc = [u['gc'] for u in ucd]
|
||||||
|
@ -68,7 +70,7 @@ for i,v in enumerate(('Cc', 'Cf', 'Cn', 'Co', 'Cs', 'Ll', 'Lm', 'Lo', 'Lt', 'Lu'
|
||||||
sc_order = dict()
|
sc_order = dict()
|
||||||
sc_array = []
|
sc_array = []
|
||||||
sc_re = re.compile(r"\b(HB_SCRIPT_[_A-Z]*).*HB_TAG [(]'(.)','(.)','(.)','(.)'[)]")
|
sc_re = re.compile(r"\b(HB_SCRIPT_[_A-Z]*).*HB_TAG [(]'(.)','(.)','(.)','(.)'[)]")
|
||||||
for line in open('hb-common.h'):
|
for line in open(hb_common_h):
|
||||||
m = sc_re.search (line)
|
m = sc_re.search (line)
|
||||||
if not m: continue
|
if not m: continue
|
||||||
name = m.group(1)
|
name = m.group(1)
|
||||||
|
|
Loading…
Reference in New Issue