4603 Commits

Author SHA1 Message Date
Just van Rossum
893c707cec
Merge pull request #1114 from fonttools/afmlib-tests
[afmLib] a small test suite for afmLib
2017-11-24 22:09:39 +01:00
justvanrossum
74faedf848 completed a comment 2017-11-24 20:02:47 +01:00
justvanrossum
6ee901cc81 added some simple tests for afmLib 2017-11-24 19:59:27 +01:00
Jens Kutilek
cb6676f93e Don't share points in cvar by default (fails in Chrome), adjust tests to test both shared and private points in cvar 2017-11-24 19:06:36 +01:00
justvanrossum
e0c275896b modernized reading/writing code 2017-11-24 17:46:31 +01:00
justvanrossum
0eb40c6346 make poor old afmLib work on py3 2017-11-24 16:48:55 +01:00
Cosimo Lupo
d08d635a93 [glyf] make splitGlyphs output more compact
removed a few extra newlines
2017-11-23 19:05:30 +01:00
Cosimo Lupo
bd030f61c6 more whitespace 2017-11-23 19:05:05 +01:00
Cosimo Lupo
f2a8c787b1 minor whitespace 2017-11-23 18:39:11 +01:00
Cosimo Lupo
2b4b563171 Bump version: 3.20.1 → 3.21.0.dev0 2017-11-23 18:32:24 +01:00
Cosimo Lupo
17b89d9dde
Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file
Add ability to split glyphs to 1 glyph per ttx file.  Issue #153
2017-11-23 18:30:54 +01:00
Bill Amidei
feb4c0d2ed Another white-space update to align 2017-11-23 07:53:07 -08:00
Bill Amidei
818a4a2d1e Review comment update: Updated white-space and removed unused test data 2017-11-23 07:51:05 -08:00
Bill Amidei
de94613e08 Updates based upon review feedback for glyf to individual files; include table name in contentOnly file; Remove unnecessary parameters from toXML - leaving only the splitGlyphs optional additional parameter 2017-11-23 07:17:35 -08:00
Cosimo Lupo
b8482d9666 Release 3.20.1 2017-11-22 18:42:53 +01:00
Cosimo Lupo
a94c16026f NEWS.rst: updated changelog 2017-11-22 18:42:48 +01:00
Cosimo Lupo
1765ed772a [unicodedata] add script_name and script_code to __all__
and cast to str to avoid error with import * in python2.7

TypeError: Item in from list'' must be str, not unicode
2017-11-22 18:37:14 +01:00
Cosimo Lupo
b354d2ee30
Merge pull request #1111 from anthrotype/script-aliases
[unicodedata] return short codes; and functions to lookup aliases
2017-11-22 18:22:14 +01:00
Cosimo Lupo
99ea0a3986 [unicodedata] add script_code func and 'default' fallback arg
`script_code` does the reverse of `script_name`: it takes a long
script name and returns a 4-letter script code.

Both `script_name` and `script_code` raise KeyError by default,
but can optionally return a default value instead.
2017-11-22 17:46:44 +01:00
Cosimo Lupo
afd2490a6c [unicodedata] add script_name function
Converts four-letter script codes to human-readable long names
2017-11-22 17:41:23 +01:00
Cosimo Lupo
012688ac20 [Tests] adjust unicodedata_test to expect short script codes 2017-11-22 17:41:23 +01:00
Cosimo Lupo
54fa00499e [Scripts] use short codes, add NAMES dict with aliases 2017-11-22 17:41:23 +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
189d158887 [travis/tox] check syntax of reStructuredText before release
I pushed a NEWS.rst with broken indentation, the PyPI page will
display plan text garbage.

Next time I'll use docutils and do `python setup.py check
--restructuredtext` before pushing a new tag.

Also, I forgot to update .travis.yml to build the dist packages
on python3.6 instead of 3.5 after I modified the tox.ini, so
the automatic release from Travis failed.

This time I had to use twine tool to upload the zip and whl
packages from my local machine to PyPI.

Sorry the mess...
2017-11-21 13:04:12 +01:00
Cosimo Lupo
f419d44512 Bump version: 3.20.0 → 3.20.1.dev0 2017-11-21 12:33:24 +01:00
Cosimo Lupo
86b06cde45 Release 3.20.0 2017-11-21 12:31:34 +01:00
Cosimo Lupo
1820bf26f1 NEWS.rst: Updated changelog
[ci skip]
2017-11-21 12:29:09 +01:00
Cosimo Lupo
25fc8d92a3
Merge pull request #1108 from anthrotype/fealib-raise-split-context
[feaLib] report error with multiple runs of marked ' glyphs
2017-11-21 12:05:51 +01:00
Cosimo Lupo
4dfea00356 [feaLib] report error with multiple runs of marked ' glyphs
As Martin Hosken reported in https://github.com/fonttools/fonttools/pull/1096,
feaLib currently incorrectly handles the case where a marked input
glyph sequence in a contextual chaining sub/pos rule is split into
multiple runs, rather than being a single continuous run of ' marked
glyphs.

The consensus there was to raise a syntax error like makeotf instead of
second-guessing and silently fixing it like fontforge does.
2017-11-21 11:42:28 +01:00
Cosimo Lupo
943b63c7d2 [tox.ini] use python3.6 for testenv:htmlcov 2017-11-21 10:24:43 +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
0be50c922c
Merge pull request #1106 from anthrotype/ucd-scripts
add fontTools.unicodedata, plus a script to fetch "Scripts.txt" from UCD
2017-11-20 19:18:43 +01:00
Cosimo Lupo
99719a8ccc [Tests] add tests for block and script_extension funcs 2017-11-20 18:17:10 +01:00
Cosimo Lupo
697b8d9af5 [unicodedata] add block and script_extension functions 2017-11-20 18:16:02 +01:00
Cosimo Lupo
8b50ed56d9 add auto-generated Blocks.py and ScriptsExtensions.py 2017-11-20 18:15:09 +01:00
Cosimo Lupo
541e7b92d3 [buildUCD] also parse Blocks.txt and ScriptExtensions.txt 2017-11-20 18:12:15 +01:00
Cosimo Lupo
6d8813c00a [Tests] move unicodedata/scripts_test to unicodedata_test 2017-11-20 18:09:56 +01:00
Cosimo Lupo
1ed78b12f5 [unicodedata] rename scripts.py to Scripts.py
let's use the same names as the original UCD data files for simplicity
2017-11-20 17:37:45 +01:00
Cosimo Lupo
203d1c6f89 [buildUCD] fix docstring 2017-11-20 15:40:56 +01:00
Cosimo Lupo
a50967d79b [Tests] add tests for 'Unknown' script 2017-11-20 15:39:07 +01:00
Cosimo Lupo
09f5f91769 [Tests] remove tests for old script impl 2017-11-20 13:40:25 +01:00
Cosimo Lupo
b53b878bdc [scripts] update auto-generated module
it now contains two list, one for the ranges and another for the script names
2017-11-20 13:38:49 +01:00
Cosimo Lupo
a17ccc47f3 [buildUCD] also write Unicode license URL to generated modules 2017-11-20 13:38:00 +01:00
Cosimo Lupo
3442da1529 [unicodedata] use bisect.bisect_right function
CPython comes with a fast C implementation of bisect module.
This gives 4 to 5 times speed-ups over my pure-python version.
2017-11-20 13:30:17 +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
2eb59f163f [Tests] add tests for unicodedata.script function 2017-11-17 19:21:45 +00:00
Cosimo Lupo
52d6131525 [unicodedata] add new module and 'script' function
The new `fontTools.unicodedata` module re-exports all the public
functions from the built-in `unicodedata` module, and also adds
additional functions.

The `script` function takes a unicode character and returns the
script name as defined in the UCD "Script.txt" data file.

It's implemented as a simple binary search, plus a memoizing
decorator that caches the results to avoid search the same
character more than once.

The unicodedata2 backport is imported if present, otherwise
the unicodedata built-in is used.
2017-11-17 19:17:17 +00:00
Cosimo Lupo
96dafe4afc [unicodedata] add auto-generated 'scripts' module
containing the script ranges and names from Scripts.txt
2017-11-17 19:16:45 +00: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
fdab63f0b6 [feaLib.ast] add __str__ to all AST elements
which calls the asFea() method,
so one can e.g. print(doc.statements[0])
2017-11-16 15:40:52 +00:00