6699 Commits

Author SHA1 Message Date
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
Cosimo Lupo
f0ab265000
svgLib: add support for converting elliptical arcs to cubic bezier curves
Fixes https://github.com/fonttools/fonttools/issues/1141

Uses code from Chromium Blink's SVG path parser, in SVGPathNormalizer::DecomposeArcToCubic
https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/core/svg/svg_path_parser.cc#L169-L278

Each elliptical arc is approximated by series of cubic bezier curves, one cubic every 90-degree portion of an arc.
2019-01-24 10:59:59 +00:00
Just van Rossum
55f48176f4
Merge pull request #1466 from chrissimpkins/glifLib-typo-fix
Minor documentation typo fix in ufoLib.glifLib
2019-01-23 17:58:38 +01:00
Chris Simpkins
7458cebda1 [ufoLib glifLib] minor typo fix 2019-01-23 11:21:06 -05:00
Khaled Hosny
098ce94edb Minor 2019-01-23 10:18:44 +02:00
Khaled Hosny
b6ec12bad0 [voltLib] Distinguish different PROCESS_MARKS
PROCESS_MARKS followed by a group name is used for markAttachmentType
lookup flag, while followed by MARK_GLYPH_SET is used for
useMarkFilteringSet. The code parsed both correctly but did not
distinguish between the two in the generated AST as it should since they
compile to different lookup flags.
2019-01-23 10:18:44 +02:00
Cosimo Lupo
660b20feca
Merge pull request #1463 from brawer/regex-escape
Fix “DeprecationWarning: invalid escape sequence” in Python 3.7
2019-01-22 16:19:06 +00:00
Cosimo Lupo
2150ef875f
py23: add backport for math.isfinite (python >= 3.2) 2019-01-22 15:42:54 +00:00
Sascha Brawer
6a7e299c09 Fix “DeprecationWarning: invalid escape sequence” in Python 3.7 2019-01-22 16:36:15 +01:00