47 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
Just van Rossum
b60df6e5ce Fix generate script to output black-compatible code 2024-05-25 17:50:16 +02:00
Cosimo Lupo
335a1e56ec re-run black v23.10 on all .py files 2023-11-03 10:25:15 +00:00
Nikolaus Waxweiler
d584daa8fd Blacken code 2022-12-13 11:26:36 +00:00
Just van Rossum
5fc65d7168
Misc py23 cleanups (#2243)
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
2021-03-29 11:45:58 +02:00
Cosimo Lupo
798608b371
Merge pull request #1927 from simoncozens/no-mktemp
Don’t use deprecated mktemp, use mkstemp instead
2020-05-11 11:10:10 +01:00
Simon Cozens
43cdc50e82 Don’t use deprecated mktemp, use mkstemp instead 2020-05-07 20:58:48 +01:00
Simon Cozens
52298f273c [docs] Update buildTableList to write documentation into ttx.rst
Have to do this a little bit differently because of the way that RtD handles comments/code blocks.
2020-05-03 22:53:59 +01: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
Mickaël Schoentgen
52e855e4a4 Use the 'with' context manager when dealing with files 2018-10-01 08:42:45 +02:00
Mickaël Schoentgen
bfde7268c3 Fix ResourceWarning: unclosed file in MetaTools 2018-09-25 23:18:21 +02: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
Cosimo Lupo
91644142e2
[MetaTools] change builtTableList.py to use README.rst instead of *.md 2017-01-18 16:16:54 +00:00
Cosimo Lupo
c1f4fff307 remove 'MetaTools/buildChangeLog.py'; hasn't been used in long time, and requires some obscure PHP script 'git2cl' 2016-08-19 11:12:02 +01:00
Cosimo Lupo
072d34062c [MetaTools/buildTableList] update README.md instead of documentation.html with tables list.
Also wrap and indent paragraph as a Markdown 'blockquote'.
2015-10-01 11:05:53 +01:00
Behdad Esfahbod
7c9ab300c2 Add standard imports to all python sources
Previously, the trivial files didn't have them.
2015-04-14 17:26:59 -07:00
Behdad Esfahbod
5cd4e51450 Update MetaTools/buildTableList.py for recent changes 2015-04-14 00:17:52 -07:00
Behdad Esfahbod
e07cc6a9ca Update MetaTools/buildTableList.py to reflect recent changes 2013-12-06 19:54:59 -05:00
Behdad Esfahbod
3ec6a25823 2to3 --fix=print with manual fixup 2013-11-27 04:57:33 -05:00
Behdad Esfahbod
ac1b435946 2to3 --fix=idioms 2013-11-27 04:15:34 -05:00
Behdad Esfahbod
a189402e27 Merge pull request #26 from olivierberten/master
Switched VCS from Subversion to git.
2013-11-25 04:44:30 -08:00
Behdad Esfahbod
0de65295f6 Remove script to build otData.py
The was was originally generated, but is static now and this
allows cleaning it up and modifying it.
2013-11-23 19:12:11 -05:00
Paul Wise
0fff29aee5 Switched VCS from Subversion to git. 2013-11-19 00:37:29 +01:00
pabs3
e57bd1eeb5 Fix the location of the SVN repository
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@618 4cde692c-a291-49d1-8350-778aa11640f8
2013-06-22 13:01:11 +00:00
jvr
a411b1ccbe cosmetic change to check whether I can check in
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@591 4cde692c-a291-49d1-8350-778aa11640f8
2012-03-01 13:26:24 +00:00
pabs3
044f8988d6 Fix arguments to diff in the roundTrip testing tool
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@567 4cde692c-a291-49d1-8350-778aa11640f8
2009-03-24 09:41:35 +00:00
pabs3
005f59e389 Adapt Doc and MetaTools to the use of SVN instead of CVS
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@565 4cde692c-a291-49d1-8350-778aa11640f8
2009-03-22 15:32:29 +00:00
pabs3
7487a3a7fb Use setup.py sdist to create the tarball for distribution
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@553 4cde692c-a291-49d1-8350-778aa11640f8
2008-05-16 14:28:58 +00:00
jvr
175f048123 whoops, rolling back accidental #! commits
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@467 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-25 08:24:37 +00:00
jvr
13325c613a [ 845172 ] Updating to Unicode 4.0.0
Instead of using a list internally, I now use a dict, since the unicode
mapping is quite sparse (lots of unused slots).


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@465 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-25 07:47:41 +00:00
jvr
4ca01eab4a output don't-edit note
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@426 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-25 21:19:47 +00:00
jvr
1397f56eb3 break out of loop when cancelled
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@350 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-12 19:14:51 +00:00
jvr
848d25d97d adapted doc string to reality; removed -v options
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@348 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-12 18:53:49 +00:00
jvr
a0af6c7dff brand new round trip tool
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@347 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-12 18:34:59 +00:00
jvr
9151a0ca0c also add tables to documentation.html
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@337 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-10 20:42:35 +00:00
jvr
06bfa0ca07 new name and location of mktarball.py
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@331 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-10 19:41:26 +00:00
jvr
0bd68dbcb6 2 scripts to generate ChangeLog file, logmerge.py is stolen from the python distro
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@325 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-10 13:25:55 +00:00
jvr
da15a425c4 tool to generate fontTools/ttLib/tables/__init__.py
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@322 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-10 13:09:27 +00:00
jvr
d954dd27f0 tool to generate the otData.py module
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@318 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-10 11:36:43 +00:00