1063 Commits

Author SHA1 Message Date
Cosimo Lupo
dc2ee4e082
glifLib_test: check case insensitive filenames are unique
tests for https://github.com/fonttools/fonttools/pull/2002
2020-07-03 11:37:17 +01:00
Cosimo Lupo
070e9a7c7d
Merge remote-tracking branch 'origin/master' into colrv1-rev2 2020-07-02 14:41:43 +01:00
Simon Cozens
ebfa4ba1fe
Move feature builders to otlLib
Refactors feaLib, moving code which builds OpenType lookups into otlLib. Note that this changes feaLib's concept of `location` from a tuple to an object.
2020-07-02 14:09:10 +01:00
Cosimo Lupo
ff79338607
rename radial gradient Paint.Affine attribute to Transform
as suggested by Peter Constable in
https://github.com/PeterConstable/OT_Drafts/blob/master/COLR_V1/COLRv1formats_rev3.md#paintformat3-table-conicalradial-gradient
2020-07-02 12:21:12 +01:00
Cosimo Lupo
ac0a755d20
make linear/radial gradient 'point-less', inline x0,y0,x1,y1,...
https://github.com/googlefonts/colr-gradients-spec/issues/21
2020-07-02 12:11:40 +01:00
Cosimo Lupo
dea9896421
rename COLR Color -> ColorIndex, transparency to alpha
https://github.com/googlefonts/colr-gradients-spec/issues/17
https://github.com/googlefonts/colr-gradients-spec/issues/19
2020-07-02 10:27:47 +01:00
Cosimo Lupo
690080b14d
use 32-bit GlyphIDs in COLRv1 baseGlyphs and layers
For forward-compatibility, see https://github.com/googlefonts/colr-gradients-spec/issues/8
2020-07-01 19:50:48 +01:00
Cosimo Lupo
4578f96e9d
colorLib_test: minor cosmetic changes 2020-07-01 18:29:26 +01:00
Cosimo Lupo
b215c000df
Rename LayerV1Array to LayerV1List, like with BaseGlyphV1List
See https://github.com/googlefonts/colr-gradients-spec/issues/14#issuecomment-652542829
2020-07-01 18:22:03 +01:00
Cosimo Lupo
5f18d9891c
rename BaseGlyphV1Array to BaseGlyphV1List
As suggested by Peter Constable in https://github.com/googlefonts/colr-gradients-spec/issues/14 and https://github.com/googlefonts/colr-gradients-spec/issues/18
2020-07-01 18:16:07 +01:00
Cosimo Lupo
50546c03c4
[C_O_L_R_test] better annotate offsets in hex dump (2) 2020-07-01 16:14:47 +01:00
Cosimo Lupo
d98e231f4b
[C_O_L_R_test] better annotate offsets in hex dump 2020-07-01 16:13:38 +01:00
Cosimo Lupo
caf3c5d216
[C_O_L_R_test] fixed typo in hex dump 2020-07-01 15:59:47 +01:00
Just van Rossum
dc7d016538
[ttLib.tables._n_a_m_e] Fix #1997: Only attempt to recovered malformed data from bytes (#1998)
* don't attempt to recover malformed data from str, only from bytes. Fixes #1997
2020-06-16 16:35:40 +02:00
Just van Rossum
90c7c7fae1
Fix for #1985: ensure that the AxisNameID in the STAT table is > 255 (#1986)
Fix for #1985:
* ensure that the AxisNameID in the STAT table is not less than 256. This needed an additional argument to the addMultiLingualName() name table method.
* fvar axis name IDs must also not be less than 256, just like STAT axis names.
2020-06-08 19:39:28 +02:00
Khaled Hosny
d2167235e0 [voltLib] Accept DO_NOT_TOUCH_CMAP keyword
Corresponds to the “Do not overwrite camp table” option in VOLT.
2020-06-08 03:19:06 +02:00
Khaled Hosny
a1df9175ee [voltLib] Support writing back ast as VOLT data
Adds __str__() method to ast classes that writes back VOLT data. Tries
to replicate VOLT syntax idiosyncrasies as much as possible for better
round-trip conversion.
2020-06-04 14:08:20 +02:00
Khaled Hosny
3c4f5a75bf [voltLib] Unescape new line in lookup comments 2020-06-04 14:08:20 +02:00
Nikolaus Waxweiler
fe17d5937a
[feaLib] Builder.build(): proper error msg on unsupported tables (#1976)
Raise NotImplementedError instead of an assertion error.
2020-05-29 16:44:19 +01:00
Nikolaus Waxweiler
0e7a4460f3
[feaLib] Introduce includeDir on Parser and IncludingLexer (#1973)
This makes the directory to search for included files explicit.

Also use Python 3's FileNotFoundError to catch non-existant files instead of a workaround for Python 2.
2020-05-28 17:43:19 +01:00
Tom Archer
0e04e039cf Add more glyphs to test group to prove order is preserved 2020-05-22 10:41:10 +01:00
Tom Archer
6f72429150 Small changes 2020-05-22 09:55:16 +01:00
Tom Archer
b88f717885 Get test working that shows duplicates are removed 2020-05-22 09:53:40 +01:00
Cosimo Lupo
7ca42f6623
Merge pull request #1967 from anthrotype/pickle
sfnt: add __getstate__ and __setstate__ to SFNTReader to make it pickelable
2020-05-19 14:03:52 +01:00
Cosimo Lupo
cdd10373f0
sfnt_test: add test for deepcopy and pickle 2020-05-19 13:19:01 +01:00
Cosimo Lupo
cbe84da8c3
varLib_test: comment why font.close() is needed 2020-05-19 10:57:09 +01:00
Cosimo Lupo
a6612aa6b5
varLib_test: close TTFont otherwise shutil.rmtree fails on Win
https://ci.appveyor.com/project/fonttools/fonttools/builds/32948704/job/hc91qjisv4nv603m#L400
2020-05-18 13:16:05 +01:00
Just van Rossum
db26cf804e
[ttLib.name] Fix findMultilingualName() (#1963)
* when reading from binary, name.string may be an encoded bytes sequence: we should call toUnicode() before we compare to the requested string

* fix expected output
2020-05-16 11:29:23 +02:00
Nikolaus Waxweiler
45a8fcefc2
[varLib] Allow feature variations to be active across the entire space (#1957)
* Allow feature variations to be active across the entire space

* Add test with empty condition set

* Skip initial box instead of removing it

* Correct comment
2020-05-15 09:27:15 -07:00
Cosimo Lupo
f4752fd412
Merge remote-tracking branch 'origin/master' into ufo-minor-format-version 2020-05-14 11:01:39 +01:00
Nikolaus Waxweiler
b07940421d Fix test_addRuleDescriptor
Use API correctly.
2020-05-13 15:45:27 +01:00
Cosimo Lupo
abf70934bc
Merge pull request #1952 from anthrotype/fix-merge-os2-mixed-versions
[merge] Fix merging different versions of OS/2 table
2020-05-13 14:33:01 +01:00
Cosimo Lupo
669b1395cb
merge_test: test merging all possible OS/2 versions with one another 2020-05-13 13:07:17 +01:00
Cosimo Lupo
842289c00e
Merge pull request #1944 from anthrotype/fix-subset-context-format-3
subset: fix AttributeError while subsetting Context{Subst,Pos} Format 3
2020-05-13 10:19:10 +01:00
Simon Cozens
b299bfb389
[feaLib] Support multiple lookups per glyph position (#1905)
This allows for more than one "lookup ..." chaining statements at each glyph position in a chaining contextual substitution or positioning rule: e.g.

    sub a b c' lookup lookup1 lookup lookup2 d;

The corresponding change in the Adobe OpenType Feature File Specification (and implementation in makeotf) happened in adobe-type-tools/afdko#1132.
2020-05-12 06:28:25 +01:00
Cosimo Lupo
8bbf30d569
subset_test: add subset of Iosekva-Medium.ttf with ContextSubstFormat3 2020-05-11 18:32:32 +01:00
Just van Rossum
a53bb37d8e
Merge pull request #1938 from justvanrossum/meta-comment
[ttLib.table._m_e_t_a] if data happens to be ascii, emit comment in TTX
2020-05-11 18:47:56 +02:00
Just van Rossum
d6bb38c7e6
[otlLib.builder] Add function to build STAT table from high-level description (#1926)
* added a function to build a STAT table: `fontTools.otlLib.builder.buildStatTable()`
* make `varLib._add_stat()` a client of `buildStatTable()`
2020-05-09 16:08:11 +02:00
justvanrossum
0dc0222f59 if the binary data happens to be ascii, emit a comment with an ascii representation 2020-05-08 10:37:01 +02:00
Cosimo Lupo
82faf2addc
ufoLib_test: fix test on pypy3
shutil.rmtree doesn't like pathlib Paths on pypy3 for some reasosn
https://travis-ci.org/github/fonttools/fonttools/jobs/684236676#L592
2020-05-07 16:53:39 +01:00
Cosimo Lupo
b617ac798e
glifLib_test: add tests for GLIF format version as tuple 2020-05-07 16:53:38 +01:00
Cosimo Lupo
b82abbc10e
ufoLib_test: add tests for new formatVersion as tuple 2020-05-07 16:53:38 +01:00
Just van Rossum
4febf38be2
[ttLib.name] Add nameTable.findMultilingualName() method (#1921)
* add nameTable.findMultilingualName(), to find an existing multilingual name
* Make addMultilingualName() reuse nameIDs if possible when asking for a new nameID, by calling findMultilingualName()
2020-05-07 11:06:51 +02:00
justvanrossum
2242aff863 fix expected gvar output to be sorted by glyph name 2020-04-29 16:32:56 +02:00
Cosimo Lupo
c8f591ea8a
subset: remove FeatureVariations table and downgrade to version 0x10000 when empty
https://github.com/fonttools/fonttools/issues/1881#issuecomment-620719882
2020-04-28 18:34:15 +01:00
Khaled Hosny
d24fd71934 [feaLib] Fix building chained alt substitutions
Support was added in db49f20d6b2629e1ba25c4afd3fb60817387f3d6, but there
was only a parser test and no builder test, fix the build and add a
builder test based on the existing parser one.

Fixes https://github.com/fonttools/fonttools/issues/1901
2020-04-28 14:29:50 +02:00
Khaled Hosny
e0c49a1d4a [feaLib] Improve exception message 2020-04-27 18:13:18 +02:00
Khaled Hosny
4526e164f1 [feaLib] Check lookup index in chaining lookups
Raise if lookup_index is None, which would happen only of the lookup
referenced belongs to the wrong table. The error message needs to be less
cryptic, though.

Fixes https://github.com/fonttools/fonttools/issues/1896
2020-04-27 02:39:33 +02:00
Cosimo Lupo
ec6205199e
subset_test: add test for dropping 'rvrn' feature and all FeatureVariationRecords
Added a TODO for the partial dropping of FeatureVariationRecords
https://github.com/fonttools/fonttools/issues/1881#issuecomment-619415044
2020-04-25 18:40:19 +01:00
David Corbett
036189b80a [agl] Support legacy glyph names
Closes #775.
2020-04-25 07:57:14 -04:00