1243 Commits

Author SHA1 Message Date
Sascha Brawer
d373808341 [AAT] Decode the morx ligature actions table 2017-10-25 15:35:56 +02:00
Sascha Brawer
a7ddb0b609 [AAT] Decode morx tables with ligature substitutions
Only handling those parts that are shared with other substitution types.
The actualy ligature actions are not implemented yet.
2017-10-25 15:35:56 +02:00
Jens Kutilek
cb364aff2c Remove outdated comment 2017-10-22 17:56:12 -04:00
Jens Kutilek
3745cf19ec Keep track of whether a tuple with proposed shared points actually can use them 2017-10-22 17:56:12 -04:00
Jens Kutilek
671cdc2edb Reactivate shared point logic 2017-10-22 17:56:12 -04:00
Jens Kutilek
abe0553c63 Fix constant name in unused code 2017-10-22 17:56:12 -04:00
Cosimo Lupo
28bb992c1f replace int(round(...)) with round(...)
We don't need to cast to int when using the round function from py23,
as this is a backport of python3's built-in round and thus it returns
an int when called with a single argument.
2017-10-22 12:03:52 +01:00
Cosimo Lupo
9d08673c2f [_n_a_m_e] pass bytes to struct when using unicode_literals
Before Python version 2.7.7, the struct.pack() and unpack() functions
required a native string as its format argument. For example:

Passing unicode strings as the struct pack/upack format would raise:

TypeError: Struct() argument 1 must be string, not unicode.

This error occurs when we use `from __future__ import unicode_literals`.

This problem was fixed in Python 2.7.7. Since then, struct now also
accepts unicode format strings.

Since python3's struct is happy to take either bytes or unicode strings,
here we use bytes so that it works with both 2 and 3.

Also see http://pythen-future.erg/stdlib_incompatibilities.html#struct-pack

Fixes https://github.com/fonttools/fonttools/issues/993
2017-10-19 14:03:24 +02:00
Cosimo Lupo
704e26b41d [glyf] enable OVERLAP_COMPOUND composite flags
it might be deprecated or ignored in some rasterizers, but I don't
see why we should discard it, if it's present in the input font.

This also allows to set the flag, which may turn out to be useful
in some circumstances.

cf. https://github.com/googlei18n/fontmake/issues/253#issuecomment-335600887
2017-10-12 18:42:01 +01:00
Jens Kutilek
a25a401fd2 Merging TT hinting (#1069)
Merge cvts; copy fpgm, prep, glyf programs from base master if compatible.
2017-10-12 10:40:40 +02:00
Behdad Esfahbod
c91f0323db Rename CVTValues to arrayTools.Vector
This is generic, and useful in other cases.
2017-10-10 12:43:15 +02:00
Jens Kutilek
8cc0df85c5 Merge branch 'master' into varlib-mutator-cvar 2017-10-09 15:21:26 +02:00
Jens Kutilek
5b39aa7af2 Implement building cvar tables 2017-10-09 13:08:55 +02:00
Cosimo Lupo
ae73c45e6a [hhea/vhea] cast to int when using math.ceil and floor
Fixes https://github.com/fonttools/fonttools/issues/1064
2017-10-05 13:27:13 +01:00
Denis Moyogo Jacquerye
7f352b028b TSI tables content as utf-8 and unicode instead of bytes (#1060)
* TSI tables content as unicode

* TSI1: update tests for utf-8
2017-09-21 18:04:57 +02:00
Martin Hosken
437b3ead2e Make python3 happy 2017-09-19 15:45:44 +02:00
Martin Hosken
9f44ce541c Run buildTableList.py 2017-09-19 15:45:44 +02:00
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
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
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
Sascha Brawer
13fe9b5c34 [AAT] Make lcar ligature carets table a format-switching table
For consistency with other AAT tables, and to support additional
formats in the (rather unlikely) case those would ever be defined.
2017-08-25 14:53:43 +02:00
Sascha Brawer
f5793401ce [AAT] Implement bsln baseline table
The AAT baseline table uses arrays whose length is constant instead of
getting encoded in the data. Extended otBase to support such arrays.
2017-08-25 03:55:06 -07:00
Sascha Brawer
61d2cde14a [AAT] Add comments to explain why we call seek() on subreader
https://github.com/fonttools/fonttools/issues/1031
2017-08-19 20:41:43 -07:00
Sascha Brawer
2f69d2959c [AAT] Fix decompilation of AppleChancery and other AAT fonts
Fixes https://github.com/fonttools/fonttools/issues/1031.
2017-08-19 20:41:43 -07:00
Sascha Brawer
a47f658855 [AAT] Support the opbd table with optical bounds
Interestingly, this can handle the examples from the AAT specification
(which are part of the unit tests), and also most AAT fonts on my disk.
However, some other AAT fonts such as Apple Chancery cannot be decompiled.
The failure seems to be a general problem with how fonttools decompiles
AAT lookups of format 4, and unrelated to this present change.
2017-08-18 08:39:44 -07:00
Cosimo Lupo
1aef1683df [otConverters] must also implement _LazyList.__radd__
We can't set, e.g. `__radd__ = NotImplemented` as it's not a callable.
NotImplemented is what is returned from a rich comparison method
when self doesn't know how to compare with the other object.

_LazyList object may also occur on the right hand side of a `+`
operator, when the left operand is a list. Also in this case we
want to first unpack the _LazyList and return a new list containing
elements from both.
2017-08-18 15:53:56 +01:00
Behdad Esfahbod
6ef48bd26f [ot] Make LazyList return regular lists in __add__ 2017-08-17 11:32:13 -07:00
Sascha Brawer
d05617b4bd [AAT] Support prop table with glyph properties 2017-08-17 11:09:53 -07:00
Cosimo Lupo
a1c2cf1137 [TupleVariation] write axis coord values as float in toXML()
https://github.com/fonttools/fonttools/pull/1026#pullrequestreview-56807115
2017-08-17 11:13:00 +01:00
Cosimo Lupo
ed0d09be22 Merge pull request #1026 from anthrotype/avar-tests
[varLib] add tests for avar; always include default maps
2017-08-17 11:12:37 +01:00
Behdad Esfahbod
03cf8fc157 Fix hhea/vhea compile with metrics tables 2017-08-16 16:42:59 -07:00
Sascha Brawer
d11e7d98e8 [AAT] Support lcar table 2017-08-16 11:47:27 -07:00