12 Commits

Author SHA1 Message Date
Cosimo Lupo
4957cd7aba buildUCD.py: minor refactorings, remove py2-isms 2025-01-29 17:48:00 +00:00
Colin Rofls
b26271cc4d [unicodedata] Fix bug in buildUCD.py
The method that was being used to read the header from the input was
inadvertently dropping the first non-header line on the floor; although
this happens to be okay in some cases (where there is an empty line
after the header) in the case of newer versions of the
ScriptExtensions.txt file, this was causing the generated code to be
missing the first entry, for U+00B7 (MIDDLE DOT)
2025-01-29 11:53:58 -05:00
Nikolaus Waxweiler
d584daa8fd Blacken code 2022-12-13 11:26:36 +00:00
Cosimo Lupo
cfc5b44c65
change all scripts' shebangs to use python3 2019-12-05 15:28:19 +00:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Cosimo Lupo
aff63b9b02 [buildUCD] parse PropertyValueAliases, write short script tags
and store a mapping from short to long names in Scripts.py
2017-11-22 17:41:23 +01:00
Cosimo Lupo
464f9821be [buildUCD] make MetaTools script not depend on fontTools
Removed fontTools imports to prevent bootstrapping issues for
downstream package maintainers that wish to run buildUCD.py at
build time (i.e. when fontTools is not installed yet).
2017-11-21 10:13:33 +01:00
Cosimo Lupo
541e7b92d3 [buildUCD] also parse Blocks.txt and ScriptExtensions.txt 2017-11-20 18:12:15 +01:00
Cosimo Lupo
203d1c6f89 [buildUCD] fix docstring 2017-11-20 15:40:56 +01:00
Cosimo Lupo
a17ccc47f3 [buildUCD] also write Unicode license URL to generated modules 2017-11-20 13:38:00 +01:00
Cosimo Lupo
5b3c189f6d [buildUCD] split generated ranges and names in two lists
to use the bisect built-in module we need to have two separate
tables, one with the ranges themselves (which we pass to bisect
to get an index) and the other containing the script name for
each range.

Also, allow the buildUCD.py script to load data files from a
local directory, e.g. to allow downstream maintainers to rebuild
the generated modules from local files instead of downloading
from Unicode website.
2017-11-20 13:25:45 +01:00
Cosimo Lupo
26db10b5ab [MetaTools] add a script to download and parse UCD data files
The script currently only parses the Scripts.txt file and
generates a new python module `fontTools.unicodedata.scripts`
containing a `SCRIPT_RANGES` list of tuples, each containing
the range and the corresponding script name.
2017-11-17 19:15:42 +00:00