4348 Commits

Author SHA1 Message Date
Cosimo Lupo
d3229d5777
feaLib: ensure languagesystems using 'DFLT' script tag precede all others
https://github.com/fonttools/fonttools/pull/1292#issuecomment-407427544

this is to match makeotf's behavior

https://github.com/adobe-type-tools/afdko/pull/498/files#diff-17824930b3cdfb707ae56e1f42bccec6R2305
2018-07-24 16:17:23 +01:00
Cosimo Lupo
1740d18584
Merge pull request #1292 from silnrsi/bugfix2
More depths to allowing languages in DFLT
2018-07-24 15:24:50 +01:00
Cosimo Lupo
248ae41e9d
loggingTools: fix CapturingLogHandler to work with py37
we can't set the logger.level directly because in py37 the logger has a _cache
attribute and that needs to be invalidated by calling setLevel method.

also, I noticed we weren't restoring the original 'disabled' attribute value...

And we need to also set/restore the 'propagate' attribute.
2018-07-24 12:17:59 +01:00
Cosimo Lupo
5a1ccf1640
Merge pull request #1297 from anthrotype/fix-mark-base-overflow
atttempt to fix offset overflows in MarkBasePos subtables
2018-07-23 12:58:39 +01:00
Cosimo Lupo
94c8bcc333
Bump version: 2.3.1 → 2.3.2.dev0 2018-07-21 19:18:11 +01:00
Cosimo Lupo
902fbc29d6
Release 2.3.1 2018-07-21 18:43:21 +01:00
Cosimo Lupo
e51f81dce4
Bump version: 2.3.0 → 2.3.1.dev0 2018-07-21 18:36:31 +01:00
Cosimo Lupo
6072fe1802
plistlib: rename some private functions
to better match the plist element names they are meant to construct
2018-07-21 18:34:27 +01:00
Cosimo Lupo
d7ac0ad359
subset: write default file extension based on --flavor or sfntVersion
Fixes https://github.com/fonttools/fonttools/issues/1298
2018-07-21 18:28:33 +01:00
Cosimo Lupo
ab3e069a25
test_plistlib: parametrize tests with use_builtin_types option 2018-07-20 19:25:19 +01:00
Cosimo Lupo
5dcf204729
plistlib: add use_builtin_types option
Fixes https://github.com/unified-font-object/ufoLib/issues/162
2018-07-20 19:20:33 +01:00
Cosimo Lupo
6e8e431dee
otTables: try to fix MarkBasePos subtable overflows
Fixes https://github.com/googlei18n/fontmake/issues/450
2018-07-19 17:52:00 +01:00
Cosimo Lupo
2798bf6d1f
otTables: print subtable type when can't split in fixSubTableOverFlows 2018-07-19 17:50:43 +01:00
Cosimo Lupo
0602e1fe7b
Release 2.3.0 2018-07-16 15:08:35 +02:00
Cosimo Lupo
bced5b62b9
Bump version: 2.2.5.dev0 → 2.3.0.dev0 2018-07-16 15:01:32 +02:00
Cosimo Lupo
42a3428d0f
writeLayerContents: make sure bytes strings in layerOrder are decoded
looks like defcon LayerSet.newLayer does not ensure the 'name' argument is a unicode
string, so serializing the layercontents.plist with the new ufoLib.plistlib may
lead to the layer name being encoded as a <data> element instead of a <string>.

Thanks Miguel for noticing this.
2018-07-15 21:32:13 +01:00
Cosimo Lupo
e15d56a2d3
test_etree: add test for pretty_print=True with ordered dict 2018-07-15 13:55:01 +01:00
Cosimo Lupo
bc7494b7f0
test_etree: start adding some unit tests to etree module 2018-07-15 12:32:17 +01:00
Cosimo Lupo
0c0d46e53b
etree: pretty_print is False by default (like in lxml) 2018-07-15 12:31:11 +01:00
Cosimo Lupo
6c6b94a580
etree: restrict py2 bytes to ASCII only 2018-07-14 20:06:22 +01:00
Cosimo Lupo
abe74f1edc
aarg! fix writeDataFileAtomically not removing empty file...
this had been broken for years, since commit 66e5ae02
2018-07-14 19:58:38 +01:00
Cosimo Lupo
b44e3d5087
validators: fixup doctests after adding unicode_literals 2018-07-14 19:42:16 +01:00
Cosimo Lupo
0951e2063e
ensure all modules do from __future__ import absolute_import, unicode_literals 2018-07-14 19:25:18 +01:00
Cosimo Lupo
83e8da2206
etree: only write self-closing <tag/> when element.text is None
like lxml does
2018-07-14 17:58:44 +01:00
Cosimo Lupo
1a94fbc121
etree: in invalid xml chars allow surrogates for 'narrow' pythons 2018-07-14 14:31:52 +01:00
Cosimo Lupo
5f61bcfcb4
etree: simplify regex for invalid xml chars 2018-07-14 14:07:42 +01:00
Cosimo Lupo
eea1766d9a
etree: fix valid XML regex for narrow UCS-2 only pythons
fixes https://ci.appveyor.com/project/adrientetar/ufolib/build/1.0.489/job/epryi911juu5lqdl#L72
2018-07-14 13:41:19 +01:00
Cosimo Lupo
d1fa34e72c
test_plistlib.py: mute harmless ResourceWarning on py27 2018-07-14 12:22:42 +01:00
Cosimo Lupo
59ac1aa357
test_plistlib: use ufoLib.etree 2018-07-13 18:50:02 +01:00
Cosimo Lupo
a9a37818cb
glifLib: use ufoLib.etree 2018-07-13 18:49:21 +01:00
Cosimo Lupo
a99a6d6ee5
plistlib: make signledispatch optional; use ufoLib.etree 2018-07-13 18:48:21 +01:00
Cosimo Lupo
d87c4edfe1
ufoLib.etree: add shim module that exports ElementTree API
works with both lxml and xml.etree backends

adds some missing things from built-in etree, such as the ability to
use an OrderedDict for attributes, support for pretty_print argument
to add indentation, etc.
2018-07-13 18:44:11 +01:00
Cosimo Lupo
49a88d6cbf
test_plistlib: must open plist as binary file
fixes https://ci.appveyor.com/project/adrientetar/ufolib/build/1.0.484/job/9em92wjinypwn2fu#L399
2018-07-12 14:10:48 +01:00
Cosimo Lupo
b743ccd2b6
utils: remove testing warning from doctest; fails with py27
I hate doctests :(
2018-07-12 13:54:19 +01:00
Cosimo Lupo
72a99726f7
test_plistlib: test deprecated readPlist/writePlist etc. as well 2018-07-12 13:47:23 +01:00
Cosimo Lupo
d664f31a50
plistlib: restore old readPlist/writePlist etc., with deprecation warning 2018-07-12 13:37:38 +01:00
Cosimo Lupo
c6bc1cda0a
add utils.py module with @deprecated decorator 2018-07-12 13:33:21 +01:00
Cosimo Lupo
a526b7170c
tests: fix expected results after Unicode 11 update
fixes https://github.com/fonttools/fonttools/issues/1291
2018-07-12 11:35:16 +01:00
Cosimo Lupo
452c85ecef
Update Blocks, Scripts and ScriptExtensions for Unicode 11
I run: python3 MetaTools/buildUCD.py
2018-07-12 11:35:16 +01:00
Cosimo Lupo
460c08286d
test_plistlib: add test for pretty_print=False 2018-07-11 18:33:10 +01:00
Cosimo Lupo
8011e828dd
glifLib: call plistlib.totree with intent_level=2
since 'lib' element is itself contained in 'glyph' root element
2018-07-11 18:32:37 +01:00
Cosimo Lupo
790876da04
plistlib: justify multiline base64 data; add 'pretty_print' option
we right-justifiy binary data text to max 76 chars (min 16) per line
similarly to the way the stdlib plistlib module does (although they
use tabs for indentation, equivalent to 8-spaces).

We write the plist doctype ourselves, otherwise lxml always adds a
newline to it (even wen pretty_print is False).
2018-07-11 18:27:12 +01:00
Cosimo Lupo
a8124a0eef
plistlib: use double-quotes in xml declaration
for consistency with glifLib
2018-07-11 13:29:54 +01:00
Cosimo Lupo
61c19acace
Add test_plistlib.py
this is basically the same cpython plistlib test suite,
rewritten as pytest-style tests
2018-07-11 12:48:14 +01:00
Cosimo Lupo
01269bfee7
test: replace all readPlist/writePlist with load/dump 2018-07-11 12:30:11 +01:00
Cosimo Lupo
584666ffe9
glifLib: use new plistlib load/dump/totree/fromtree 2018-07-11 12:29:18 +01:00
Cosimo Lupo
0b15b7d61e
ufoLib: use new plistlib load/dump instead of readPlist/writePlist 2018-07-11 12:28:26 +01:00
Cosimo Lupo
0776e9405c
remove ufoLib.plistFromETree, superseded by new plistlib 2018-07-11 12:27:47 +01:00
Cosimo Lupo
715d6c6b68
Add plistlib module from ufoLib2
https://github.com/fonttools/ufoLib2/blob/master/src/ufoLib2/plistlib.py

replaces the old ufoLib.plistlib shim, privides a single interface
similar to python3's stdlib `plistlib` module, but built on top of
lxml.

On python < 3, it requires the singledispatch backport.
This will be added as conditional installation requirement.
2018-07-11 12:26:00 +01:00
Cosimo Lupo
657b4cf496
test_glifLib: add test to check double-quoted XML_DECLARATION 2018-07-10 18:56:30 +01:00