6807 Commits

Author SHA1 Message Date
Rod Sheeter
1292029be2 test for basic rounded rect 2019-02-08 10:50:22 -08:00
Rod Sheeter
f0e8e72187 Test wiring for <rect> import 2019-02-08 10:06:14 -08:00
Cosimo Lupo
173a0f5011 [C_P_A_L_] make Color a subclass of namedtuple
so that's comparable/hashable/immutable and can be used as key in a dict or set.

The fromXML instance method was dropped since it relied on the object being mutable.
A fromHex classmethod replaces it.
2019-02-08 01:16:47 +01:00
Read Roberts
4de8342310
Merge pull request #1490 from anthrotype/fix-subset-desubroutinize
[subset] Fix 'AttributeError: GlobalSubrs' with --desubroutinize option
2019-02-06 20:18:08 -08:00
Cosimo Lupo
8e8da97a4c [cffLib]: add clear() method to Index class to empty in-place 2019-02-07 01:58:22 +01:00
Cosimo Lupo
97006a0d67 [subset] Fix 'AttributeError: GlobalSubrs' with --desubroutinize option
Fixes #1483

'remove_unused_subroutines' method expects a 'GlobalSubrs' attribute but the 'desubroutinize'
method deletes it. We don't have to call 'remove_unused_subroutines' at the end of 'desubroutinize'
method, we can just delete all the local subroutines, and clear the GlobalSubrsIndex.

Only call 'remove_unused_subroutines' method once, when we are not desubroutinizing.
2019-02-07 01:51:05 +01:00
Cosimo Lupo
027501cc26 .travis.yml: need to use 'dist: xenial' for pypy 6.0 2019-02-06 22:27:17 +01:00
Cosimo Lupo
74d683d04b .travis: use pypy2.7-6.0
5.8.0 seems to be no longer available on travis.
this should be the latest one currently available.
https://travis-ci.org/fonttools/fonttools/jobs/489641018
2019-02-06 22:19:07 +01:00
Nikolaus Waxweiler
bc9d6c6b36
Merge pull request #1489 from madig/cffLib-PrivateDict-refactor-getattr
[cffLib] Replace `PrivateDict.__getattr__` with property for `in_cff2`
2019-02-06 17:03:59 +00:00
Nikolaus Waxweiler
a8d4bfc42d Replace PrivateDict.__getattr__ with property
The dunder method doesn't seem to be doing anything other than providing
an `in_cff2` attribute. Do that with a property instead of bending
__getattr__.

This one confused me when I was working on
https://github.com/fonttools/fonttools/pull/1488.
2019-02-06 10:15:38 +00:00
Cosimo Lupo
649dc49dba [cffLib] Fix RecursionError in BaseDict.__getattr__ when unpickling
We need to raise AttributeError for non-existing dunder methods like
'__deepcopy__' or '__getstate__', because deepcopy() and pickle.load()
test for these on the instance using getattr() and treat the resulting
AttributeError as a signal that the object doesn't implement these custom
hooks. If we don't do that, we enter an infinite recursion as we attempt
to look up the missing dunder methods in the 'rawDict' dictionary,
because 'rawDict' is set inside __init__, but __init__ is not invoked
while unpickling (only __new__ is); thus self.rawDict is also missing
and __getattr__ is invoked with argument 'rawDict' again and again until
it crashes with RecursionError. Phew.

Fixes https://github.com/fonttools/fonttools/pull/1488
2019-02-06 01:05:11 +01:00
Cosimo Lupo
8832062c40
Merge pull request #1488 from madig/fix-cff-deepcopy
WIP: Fix deepcopy-ing of CFFs
2019-02-06 01:00:39 +01:00
Nikolaus Waxweiler
e50733df21 Make simpler test in cffLib tests 2019-02-05 14:33:58 +00:00
Nikolaus Waxweiler
3011f3b7d4 Add smoke-test for layout interpolation of OTFs 2019-02-05 13:57:01 +00:00
Nikolaus Waxweiler
8bff72139c Reinstate fixed load_masters() 2019-02-05 13:02:53 +00:00
Nikolaus Waxweiler
9739dc7d86 Bump version: 3.37.3 → 3.37.4.dev0 2019-02-05 12:50:18 +00:00
Nikolaus Waxweiler
e90d6f3166 Release 3.37.3 2019-02-05 12:50:17 +00:00
Nikolaus Waxweiler
b517d95b77
Merge pull request #1487 from madig/rechange-lineendings-to-lf
Rechange line-endings of some files from DOS to Unix
2019-02-05 12:49:40 +00:00
Nikolaus Waxweiler
45cc01a1d1 Add .gitattributes to enforce native line-endings 2019-02-05 12:11:25 +00:00
Nikolaus Waxweiler
6c0bcb9073 Convert line-endings back from DOS to Unix 2019-02-05 12:10:51 +00:00
Nikolaus Waxweiler
3892493fc5 Bump version: 3.37.2 → 3.37.3.dev0 2019-02-05 11:41:23 +00:00
Nikolaus Waxweiler
26da00ee54 Release 3.37.2 2019-02-05 11:41:21 +00:00
Nikolaus Waxweiler
1e746e34ee
Revert "load_masters: actually assign font attributes" (#1486)
* Revert "load_masters: actually assign font attributes"

This reverts commit ef1d4cd02d1e46f5dac3914f547a6e4275cf3077, which caused a
crash in `interpolate_layout()` when `deepcopy`ing OTFs.

Amend code and tests while I work on a real fix.
2019-02-05 11:38:46 +00:00
Khaled Hosny
b68596cc80 [feaLib] Add an ast test for the previous commit 2019-02-05 13:10:33 +02:00
Khaled Hosny
83434b4286 [feaLib] Escape glyph names matching keywords
Glyph names matching reserved keywords were not consistently escaped;
they were escaped in GDEF classes but not elsewhere. Call module’s
asFea() function in GlyohName.asFea() to ensure they are consistently
escaped.
2019-02-05 13:10:33 +02:00
Khaled Hosny
a291e9a2f1 [feaLib] Add table names to reserved keywords
Apparently AFDKO expects these to be escaped in glyph names.
2019-02-05 13:10:33 +02:00
Denis Moyogo Jacquerye
303c7247e1 Bump version: 3.37.1 → 3.37.2.dev0 2019-02-05 09:26:05 +00:00
Denis Moyogo Jacquerye
adbec1fb91 Release 3.37.1 2019-02-05 09:26:05 +00:00
Nikolaus Waxweiler
0322f2dc0b
Merge pull request #1485 from madig/update-changelog
Update changelog [skip ci]
2019-02-05 09:24:21 +00:00
Nikolaus Waxweiler
02a2d9f184 Update changelog [skip ci] 2019-02-05 09:18:10 +00:00
Khaled Hosny
05329ed033 [feaLib] Fix double indentation of markClass
When a MarkClassDefinition is inside a block, it gets double indentation
compared to the rest of the block. It should ignore the indent argument
like other similar statements.
2019-02-05 00:46:58 +02:00
Nikolaus Waxweiler
376b904352
Merge pull request #1477 from madig/varLib-sparse-master-MVAR-generation
[varLib] Fix MVAR generation for sparse masters

Also actually assign loaded fonts to the `.font` attribute in `load_masters`.
2019-02-04 16:48:33 +00:00
Nikolaus Waxweiler
63a56b98fd _add_MVAR: set model only once, after a tables have been fetched 2019-02-04 16:03:47 +00:00
Denis Moyogo Jacquerye
5e3f3eded1
Merge pull request #1469 from khaledhosny/voltlib-coverage
[voltLib] Return a tuple from parse_coverage_()
2019-02-02 07:45:21 +00:00
Khaled Hosny
cedf79b505 [voltLib] Return a tuple from parse_coverage_()
This is a followup to commit 94633e9f46975c356ec3a2d21ed30768c2fa0cd5,
where I mistakenly made it return an Enum but parse_coverage_() it not
used only for ENUMs and in many (most?) places returning an Enum is
wrong as you have a list of separate items that has to rmain separate.
2019-02-02 01:13:14 +02:00
Nikolaus Waxweiler
ef1d4cd02d load_masters: actually assign font attributes 2019-01-30 15:15:28 +00:00
Chris Simpkins
1c0a55905b [Snippets] added usage documentation as a Markdown block in the notebook 2019-01-29 23:55:51 -05:00
Chris Simpkins
33b03e3edd [Snippets] add name-viewer.ipynb jupyter notebook 2019-01-29 23:30:49 -05:00
Cosimo Lupo
7d975f7ada
Bump version: 3.37.0 → 3.37.1.dev0 2019-01-28 21:56:19 +00:00
Cosimo Lupo
2def727585
Release 3.37.0 2019-01-28 21:56:18 +00:00
Cosimo Lupo
6755c2dffa
Update changelog [skip ci] 2019-01-28 21:56:05 +00:00
Khaled Hosny
354b89c068 [feaLib] Implement ValueRecord.asFea()
ValueRecord had a makeString() method that takes an optional “vertical”
argument, but no code outside the tests sets this argument. Renamed it
to asFea() and dropped the “vertical”, so that it consistent with the
rest of feaLib.ast classes.
2019-01-28 11:52:36 +02:00
Khaled Hosny
e974ea3871 [feaLib] Add tests for ValueRecordDefinition.asFea()
Currently fail as it calls ValueRecord.asFea() which is not implemented.
2019-01-28 11:52:36 +02:00
Cosimo Lupo
0293a392ad
varLib: apply HIDDEN flag to fvar axis if hidden=1 in designspace axis
Fixes https://github.com/fonttools/fonttools/issues/1085
2019-01-27 10:57:08 +00:00
Khaled Hosny
f48f4cc6b4 [feaLib] Round-trip useExtension keyword 2019-01-27 12:16:35 +02:00
Denis Moyogo Jacquerye
18ac453781
Merge pull request #1467 from khaledhosny/voltlib-glyph-type
[voltLib] Accept COMPONENT glyph type
2019-01-24 14:24:18 +00:00
Khaled Hosny
c5bbd39577 [voltLib] Add test for MARK glyph type 2019-01-24 13:59:06 +02:00
Khaled Hosny
cd553debc3 [voltLib] Accept COMPONENT glyph type 2019-01-24 13:55:53 +02:00
Cosimo Lupo
1bb55b5c7e
Merge pull request #1464 from anthrotype/svg-path-arc-to-cubic
svgLib: add support for converting elliptical arcs to cubic bezier curves
2019-01-24 12:25:49 +01:00
Cosimo Lupo
fd219f5d93
add tests for parsing SVG arcs 2019-01-24 11:16:49 +00:00