273 Commits

Author SHA1 Message Date
Cosimo Lupo
a0bd872f0e TupleVariation: make shared tuples order deterministic
most frequent first (like before https://github.com/fonttools/fonttools/pull/2351), only sort ties alphabetically
2021-07-02 12:52:54 +01:00
Cosimo Lupo
d0d59d2f2c Add PaintScale* and Paint{Rotate,Skew}* variants
This updates fonttools to match the latest draft COLRv1 spec at https://github.com/googlefonts/colr-gradients-spec/pull/290

Summary of changes:
- Added 8 new PaintScale* tables: with/without centers, uniform vs non-uniform
- Added *AroundCenter variants to PaintRotate and PaintSkew (default versions no longer have centerX/Y defaulting to origin)
- PaintRotate, PaintSkew and PaintComposite formats re-numbered
2021-06-28 18:38:47 +01:00
Cosimo Lupo
1cb7e36bbd COLRv1: rename otData structs to remove 'V1' to match updated draft spec
This is a breaking change (but the COLRv1 API was already marked as unstable and subject to change)

The changes in this PR are meant to match the changes from the COLRv1 draft spec at:
https://github.com/googlefonts/colr-gradients-spec/pull/302
2021-06-28 16:13:47 +01:00
Cosimo Lupo
adbe4c3de7 otTables_test: mixed tabs and spaces 2021-05-20 19:22:24 +01:00
Cosimo Lupo
d1e2e0e381 otTables: ignore Format attribute in split.*Subst overflow-fixing methods
Fixes https://github.com/fonttools/fonttools/issues/2319
2021-05-20 19:19:37 +01:00
Eigi
20c4a3ce74 test if issue #2295 is fixed 2021-05-13 09:58:53 +01:00
Just van Rossum
d601951eab
[otTables] Default varIdx should be 0xFFFFFFFF (#2298)
* default value for varIdx should be 0xFFFFFFFF to indicate 'no variations'

* use lc hex notation as per feedback
2021-05-07 22:26:48 +02:00
Garret Rieger
1bb3183231 Add tests for lazy loading of MVAR with more than 8 value records. 2021-04-21 14:37:47 -07:00
Behdad Esfahbod
bcd4a62f10 [TupleVariation] Use b'' instead of NotImplemented for "use shared points" 2021-04-09 12:16:15 -06:00
Behdad Esfahbod
ef0d695de9 [TupleVariation] Remove unused usesSharedPoints return from tv.compile() 2021-04-09 12:13:49 -06:00
Behdad Esfahbod
f7b66c7af2 [VariationData] Fix tests after recent changes 2021-04-08 18:31:24 -06:00
Behdad Esfahbod
1e6b20cc2c [TupleVariation] Don't round deltas (again!)
Remove tests that passed float in.
2021-04-08 09:41:45 -06:00
Behdad Esfahbod
e9acd9634f [GlyphCoordinates] Store int data as 4byte, not 2byte
The memory increase is negligible, but means that we don't have to
worry about integer overflows anymore.
2021-04-08 09:41:45 -06:00
Zachary Scheuren
41da60f130 Add missing dict operators to CFF2 2021-03-30 21:24:14 +09:00
Just van Rossum
5fc65d7168
Misc py23 cleanups (#2243)
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
2021-03-29 11:45:58 +02:00
Behdad Esfahbod
2a483f9856 [Tests] Fix most test expectations for AlternateSubst .Format removal 2021-03-23 18:01:32 -07:00
Behdad Esfahbod
8f79235d00 [Tests] Remove hack after Coverage .Format removal 2021-03-23 11:44:13 -07:00
Behdad Esfahbod
d6bdfba587 [Tests] Fix more test expectations for SingleSubst .Format removal 2021-03-23 11:43:55 -07:00
Behdad Esfahbod
6b2b2f4949 [Tests] Fix most test expectations for ClassDef[12] .Format removal 2021-03-23 11:43:46 -07:00
Behdad Esfahbod
9ac1f39045 [Tests] Fix most test expectations for AlternateSubst .Format removal 2021-03-23 11:43:22 -07:00
Behdad Esfahbod
b62170e86d [Tests] Fix most tests expectations for LigatureSubst .Format change 2021-03-23 11:43:15 -07:00
Behdad Esfahbod
61b06a7fe0 [Tests] Fix most tests expectations for SingleSubst .Format change 2021-03-23 11:43:03 -07:00
Behdad Esfahbod
de81aae164 [Tests] Fix more tests expectations for Coverage/ClassDef .Format change 2021-03-23 11:42:54 -07:00
Behdad Esfahbod
975f85ed72 [Tests] Fix most tests expectations for Coverage/ClassDef .Format change 2021-03-23 11:42:38 -07:00
Zachary Scheuren
0434b1a917
Add feaLib support for STAT table 2021-02-25 17:16:01 +00:00
rsheeter
7abd234929
Update tests for new formats 2021-02-15 10:42:59 +00:00
Cosimo Lupo
82c32cbf88
C_O_L_R_test: fix incorrect NumLayers
there's actually 3 LayerRecords defined in the COLR_V1_SAMPLE, not 4.
2021-02-05 10:36:12 +00:00
Cosimo Lupo
a7d145f027
update tests for PaintSweepGradient 2021-02-03 19:11:44 +00:00
Cosimo Lupo
93c23eaaf7
COLRv1: define new PaintSweepGradient, amend tests with new format numbers 2021-02-03 18:21:09 +00:00
Cosimo Lupo
d8c42ef7f0
codecs: handle errors different from 'strict' for extended mac encodings
Fixes #2132
2020-12-24 20:37:52 +01:00
Cosimo Lupo
538528d5a1
COLRv1: Implement PaintTranslate
https://github.com/googlefonts/colr-gradients-spec/pull/163
2020-12-15 16:58:31 +00:00
rsheeter
40f95ba4ea Update C_O_L_R_test.py; try to make the binary data test more palatable 2020-12-03 12:48:47 -08:00
Cosimo Lupo
698d43cfb0
C_O_L_R_test: update table's handwritten binary blobs 2020-11-11 17:41:44 +00:00
Cosimo Lupo
c695429b1b
C_O_L_R_test: undo PaintColrSlice 2020-11-11 17:41:44 +00:00
Cosimo Lupo
e992953474
swap xy and yx fields in COLRv1 Affine2x3 struct
following the latest draft
See discussion at https://github.com/googlefonts/colr-gradients-spec/pull/85
2020-10-30 19:29:59 +00:00
Cosimo Lupo
6c752f677f
rename Paint{ColorGlyph,ColrSlice} 2020-10-27 19:15:50 +00:00
Cosimo Lupo
b654554109
add {First,Last}LayerIndex to PaintColorGlyph
as proposed in https://github.com/googlefonts/colr-gradients-spec/issues/86

The name of PaintColorGlyph may still change to PaintColorSlice, or PaintColrSlice, or PaintColorGlyphSlice, etc."
https://github.com/googlefonts/colr-gradients-spec/pull/87
2020-10-27 12:47:10 +00:00
Cosimo Lupo
ce11d0ede8
C_O_L_R_test: test roundtrip Paint{Transform,ColorGlyph,Composite} 2020-10-26 18:14:13 +00:00
Cosimo Lupo
fc625963fa
otTables: dump the format name of Paint tables as XML comment 2020-10-20 19:03:17 +01:00
Cosimo Lupo
73073be3c2
Affine2x3 struct should be inlined inside PaintTransform
Not pointed to by an Offset32.
Thanks Dominik for spotting this!
2020-10-12 14:32:23 +01:00
Cosimo Lupo
7f6a05b007
otData: add new COLR Paint struct definitions, update to latest draft
Update C_O_L_R_test.py accordingly.

a
2020-10-09 19:36:35 +01:00
Just van Rossum
bec19252c5
[ttLib] Fix for #2044: fix maxp.maxComponentDepth calculation (#2045)
Fix for #2044: don't overwrite the initial maxComponentDepth variable, as this will give the wrong value when there are multiple nested components.
2020-08-14 20:13:01 +02:00
Cosimo Lupo
09c0e42031
Partly revert "use 32-bit GlyphIDs in COLRv1 baseGlyphs and layers"
This reverts commit 690080b14d9a4f193092ffc172a39b3e212d307c.

We keep 16-bit GlyphIDs for COLRv1 tables, at least for now
https://github.com/googlefonts/colr-gradients-spec/pull/24

I keep the GlyphID32 converter in case we may need it in the future.
2020-07-08 16:06:45 +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
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