4338 Commits

Author SHA1 Message Date
Martin Hosken
b0ae563d4d Add Graphite table tests 2017-09-19 15:45:44 +02:00
Martin Hosken
84ce740814 Bug fixes 2017-09-19 15:45:44 +02:00
Martin Hosken
1d164cc9c0 Make python3 happy with lambdas 2017-09-19 15:45:44 +02:00
Martin Hosken
0aab423993 Tidy up PR 2017-09-19 15:45:44 +02:00
Martin Hosken
e29a41bbe3 Fix Silf v2 support 2017-09-19 15:45:44 +02:00
Martin Hosken
a997fae488 Some light pep8ing 2017-09-19 15:45:44 +02:00
Martin Hosken
4400854ff0 Tidy up output 2017-09-19 15:45:44 +02:00
Martin Hosken
eb9eebf972 Use glyph names not glyph ids 2017-09-19 15:45:44 +02:00
Martin Hosken
860a8e0522 Handle all Graphite tables now 2017-09-19 15:45:44 +02:00
Martin Hosken
bb162e00b9 Support Silf table 2017-09-19 15:45:44 +02:00
Martin Hosken
575b44e1f6 Get Glat and Gloc working for ttx 2017-09-19 15:45:44 +02:00
Behdad Esfahbod
a302000023 [merge] Remove debug asserts
Fixes https://github.com/fonttools/fonttools/issues/1056
2017-09-18 13:10:03 -04:00
Cosimo Lupo
588f5246c0 [varLib] default to using "name" attribute if "labelname" is missing
Instead of raising AssertionError when users define custom axes
without explicit `<labelname xml:lang="en">ZZZZ</labelname>` element,
it's better to use the axis' name attribute, and treat it as "en"
language.

For example, if users generate the designspace from SuperPolator,
they can't edit the axis labelname attribute from the UI (or maybe
it's just me that couldn't figure out how to do it).
2017-09-15 16:49:16 -04:00
Behdad Esfahbod
556508b0e9 [merge] Remove unused features & lookups 2017-09-15 00:58:42 -04:00
Behdad Esfahbod
d802580cee [merge] Merge Script records, almost properly
Right now only merges DefaultLangSys.  Also, does not remove unused Feature's after merge.
Moreover, does not merge kind Lookups of the same Feature.

But it works!
2017-09-15 00:58:42 -04:00
Behdad Esfahbod
d76d6c1a5f [merge] Remove lookup_id() / feature_id(), use custom dict
I added the id() trick because normal objects are not hashable in Python3.
Remove that hack and use a custom dict subclass that allows us to use
objects as keys as long as they don't change.

The custom dict has a different, desirable, property as well: upon seeing
keys it does not know, it just adds them to the end of the list.  Will use
this feature in next commits to merge ScriptList properly.
2017-09-15 00:58:42 -04:00
Behdad Esfahbod
93763eec0b Minor 2017-09-15 00:58:42 -04:00
Behdad Esfahbod
9d5a468781 [merge] Define lookup_id() and feature_id()
Prepare to merge ScriptRecords properly
2017-09-15 00:58:42 -04:00
Cosimo Lupo
84a2de0fe6 Merge pull request #1053 from anthrotype/svg2glif-snippet
[Snippets] add script to convert SVG outlines to UFO GLIF
2017-09-13 04:15:30 +01:00
Cosimo Lupo
eab152e297 [Snippets] add script to convert SVG outlines to UFO GLIF
(requires ufoLib)
2017-09-12 23:09:31 -04:00
Cosimo Lupo
71e97b3e74 Merge pull request #1051 from anthrotype/svg-parse
add parser for SVG paths supporting the pen protocol
2017-09-13 03:36:30 +01:00
Cosimo Lupo
de59719db4 move stuff to fontTools.svgLib.path sub-package
in case later on we want to add things to svgLib which don't have to do with paths specifically
2017-09-12 22:21:20 -04:00
Cosimo Lupo
ecf781cfce move fontTools.misc.svgPath to fontTools.svgLib 2017-09-12 08:46:04 -04:00
Cosimo Lupo
69a75f5f3a [Tests/misc/svgPath] add tests for SVGPath and parse_path 2017-09-11 17:38:33 +01:00
Cosimo Lupo
ce530a51d3 [svgPath] tag ImportError with '# pragma nocover'
It appears that cElementTree is still present as a deprecated alias in python 3
We tell coverage to skip this branch since it is not (currently) being hit
2017-09-11 17:35:46 +01:00
Cosimo Lupo
cb72f9499c [svgPath/parser] typo 2017-09-11 17:34:04 +01:00
Cosimo Lupo
d6f54f90bd [svgPath/parser] handle open paths with endPath() 2017-09-11 17:31:58 +01:00
Cosimo Lupo
d093eba098 [svgPath] add SVGPath class supporting the Pen protocol 2017-09-08 19:26:57 +01:00
Cosimo Lupo
433c7a4f91 [svgPath.parser] add standard __future__ and py23 imports 2017-09-08 18:17:34 +01:00
Cosimo Lupo
cb91e3d742 [svgPath] export parse_path function from svgPath.parser submodule 2017-09-08 18:17:34 +01:00
Cosimo Lupo
e431bc2dc2 make svgPath into a package; mv svgPath.py svgPath/parser.py 2017-09-08 18:16:02 +01:00
Cosimo Lupo
ed4cfcdf82 [svgPath] add docstring to parse_path; make 'current_pos' a tuple 2017-09-08 18:16:02 +01:00
Cosimo Lupo
1ba2c3fe9c [svgPath] modify parse_path so it calls pen object directly 2017-09-08 18:16:02 +01:00
Cosimo Lupo
e2bb8f3053 [svgPath] add copy of parser module from svg.path package
The upstream code comes from here:

https://github.com/regebro/svg.path

I prefer to 'vendor' the svg path parser instead of adding it as a
requirement to fonttools, because this way we can patch it to call a
pen object directly instead of returning a list of Path instances.

Also I'm only interested in the parser module, the rest of svg.path
is not useful here.

The license of svg.path is MIT, so it's compatible with fonttools
license (BSD 2-clause).

I added the original code so it's clear from the subsequent commits
what changes are being applied.
2017-09-08 17:41:19 +01:00
Sascha Brawer
db0d193db6 [AAT] Support cidg table with CID-to-glyph mapping 2017-09-06 12:52:22 +02:00
Sascha Brawer
0f05f824d2 [AAT] Support gcid table with glyph-to-CID mapping 2017-09-06 01:40:49 +02:00
Sascha Brawer
ee1662e57e [AAT] Support morx tables with contextual substitution 2017-09-05 23:01:21 +02:00
Sascha Brawer
31b02d0bed [AAT] Support morx tables with Rearrangement subtables 2017-09-04 21:26:53 +02:00
Sascha Brawer
49fc88244b [AAT] Write AATLookups to XML in alphabetical order again
The XML output for other tables is also sorted alphabetically
by glyph name, not by glyph order.

This reverts commit c77e9fe12d5879aeb79c05f8ececebb3275524b7.
2017-09-01 15:56:21 +02:00
Sascha Brawer
c77e9fe12d [AAT] Write AATLookups to XML in glyph order
Before this change, the AAT lookups were alphabetically sorted by glyph name,
but it seems more natural to write XML in the usual glyph order. No changes to
the binary format (which already was in glyph order); this only affects how
XML output is produced.
2017-08-31 17:50:45 +02:00
Sascha Brawer
f80b341977 [AAT] Another unit test for decoding the ankr anchor points table 2017-08-31 14:44:24 +02:00
Sascha Brawer
898f6911f8 [AAT] Implement subsetting of anchor points table 2017-08-31 12:49:55 +02:00
Sascha Brawer
92124ee5a6 [AAT] Implement anchor point table
The AAT `ankr` anchor point table is an auxiliary table for `kerx`,
used to store anchor overrides in case the glyph itself does not
supply the needed anchors as control points. Among the fonts that
come pre-installed with MacOS 10.12.6, `ankr` is used by a handful
of non-Latin fonts such as “Myanmar MN”, “Devanagari Sangam MN”,
and “Arial HB”.

https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6ankr.html
2017-08-31 11:45:18 +02:00
Sascha Brawer
90f257cc60 [AAT] Support mort and morx tables with non-contextual substitutions
Other metamorphosis types are not yet supported and will raise an error
upon decompilation. The TTX tool catches the error and continues to emit
a hexdump of the table contents, just as before this change.
2017-08-30 14:46:34 +02:00
Sascha Brawer
7bb171ed4a [AAT] Do not assume that StructWithLength is always 32 bits long
Most AAT tables encode struct lengths into 32 bits but some use only 16.
Therefore, take the size of the encoded struct length from otData.
2017-08-29 09:49:39 +02:00
Sascha Brawer
5d8a9df7fb [AAT] Make StructLength a computed value 2017-08-29 09:34:25 +02:00
Behdad Esfahbod
48bb8d9d59 [subset] Further minor simplification 2017-08-27 18:31:34 -07:00
Behdad Esfahbod
2d755f0d39 [subset] Simplify glyf.closure_glyphs() similarly 2017-08-27 18:30:04 -07:00
Behdad Esfahbod
61ac8e7589 [subset] Simplify COLR.closure_glyphs() 2017-08-27 18:27:03 -07:00
Sascha Brawer
307d0d4c57 [AAT] Implement subsetting of baseline table 2017-08-26 09:53:04 +02:00