43 Commits

Author SHA1 Message Date
Cosimo Lupo
f24a640b65
minor 2020-12-08 10:01:37 +00:00
rsheeter
17395b0769
id() invalid if things disappear 2020-12-08 10:00:47 +00:00
Cosimo Lupo
bd8861f10d
sort __dict__.items() when freezing paint tuples 2020-12-08 10:00:46 +00:00
rsheeter
f0dcd335bb
Cache tuples 2020-12-08 10:00:27 +00:00
rsheeter
d888526659 Hook up paint skew and rotate 2020-12-02 21:21:19 -08:00
Cosimo Lupo
e5439eb92b
colorLib: also treat lists [layerGlyph, paletteIndex] as COLRv0 layers
Don't be too strict about them being tuple type. Plist doesn't distinguish the two.
Fixes https://github.com/googlefonts/ufo2ft/issues/426
2020-11-16 16:38:22 +00:00
rsheeter
cf2097f7c0 Update to builder per review discussion 2020-11-10 21:51:33 -08:00
rsheeter
cd39e6e246 Add a test 2020-11-06 14:59:52 -08:00
rsheeter
3069ad97ee Less errorprone message 2020-11-06 12:20:26 -08:00
rsheeter
5c83b5be47 Don't generate a PaintColrLayers for a list of 1 2020-11-04 21:59:30 -08:00
rsheeter
9698c71198 Change case of LayerCollector fields per comment 2020-11-04 18:47:16 -08:00
rsheeter
f531038bf9 Start hooking up revised PaintColrLayers 2020-11-04 14:36:43 -08:00
Cosimo Lupo
581416d77c
WIP: add buildPaintColrLayers 2020-11-03 19:11:24 +00:00
rsheeter
d285481215 Fix f-string 2020-11-03 11:06:23 -08: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
1803283baf
colorLib: use IntEnum instead of 'magic' Paint format integers
makes code more readable
2020-10-26 18:14:13 +00:00
Cosimo Lupo
53b0034b35
colorLib: check that values fit fixed or integer types
continue building all glyphs, accummulate errors and only stop at the end

fixup
2020-10-23 17:09:44 +01:00
Cosimo Lupo
a2aaf41a7e
colorLib: rename builders to match current Paint format names 2020-10-09 19:36:35 +01:00
Cosimo Lupo
fdf6a5c1fc
colorLib: update builders to latest COLRv1 draft
LayerV1Record and Affine2x2 are gone.
LayerV1List now contains a list of Paint DAGs
Added 4 new Paint formats: PaintGlyph, PaintColorGlyph, PaintTransform
and PaintComposite
2020-10-09 19:36:35 +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
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
Simon Cozens
a114ec2c20
[docs] Reorganise colorLib docs (#1936)
Does not add any new documentation (there is already some documentation for user-facing functions). It just makes colorLib.builder the top-level documentation entry, because that’s the part the user needs to care about.
2020-05-12 11:19:17 +01:00
Cosimo Lupo
971bcbff6f
colorLib: allow color stops to be built from list of dicts as well as tuples 2020-03-12 16:03:11 +00:00
Cosimo Lupo
b7f9d8d564
colorLib: minor simplify buildPoint
this also allows to build from any sequence or iterable, not just tuple
2020-03-12 15:10:30 +00:00
Cosimo Lupo
4433b29c55
colorLib: fix type hints of 'extend' param in buildColorLine
accept either int, str ('pad', 'repeat', 'reflect') or ExtendMode enums
2020-03-11 19:07:14 +00:00
Cosimo Lupo
5a8830ebc9
colorLib_test: add test for buildCORL with automatic or explicit 'version' 2020-03-11 19:01:25 +00:00
Cosimo Lupo
63e2be484e
colorLib: refactor _splitSolidAndGradientGlyphs and add test 2020-03-11 14:22:58 +00:00
Cosimo Lupo
5629d5d8d9
colorLib: allow to build Paint, ColorLine, Color from dict 2020-03-11 13:27:59 +00:00
Cosimo Lupo
2f264bcb76
colorLib: add separate buildLayerV1Record and buildBaseGlyphV1Record functions 2020-03-10 15:33:52 +00:00
Cosimo Lupo
44d729ad3c
colorLib: in buildColorStop accept color tuple as parameter
and use Sequence instead of List for input params type hints
2020-03-10 11:49:04 +00:00
Cosimo Lupo
b640897a9a
colorLib: must copy p1 when p2 is None
ot.Point is mutable
2020-03-09 19:20:15 +00:00
Cosimo Lupo
1362ba4ba1
colorLib: minor: rename stopOffset parameter to offset 2020-03-09 16:45:56 +00:00
Cosimo Lupo
82c2b3632f
minor: fix type hint 2020-03-09 15:01:50 +00:00
Cosimo Lupo
d098789206
default transparency is 0 (fully opaque)
I was confusing 'transparency' with SVG-like 'opacity' which defaults to 1.0.
Here 1.0 means fully transparent, so it makes sense the default to be 0.0 for fully opaque
2020-03-09 14:50:06 +00:00
Cosimo Lupo
0e0254b0de
colorLib: add builder functions for COLRv1 tables 2020-03-06 18:37:30 +00:00
Cosimo Lupo
bb46604ec2
colorLib: allow to build CPAL version=1 2020-02-17 18:25:45 +00:00
Cosimo Lupo
7a2f68a317
colorLib: add type annotations 2020-02-17 12:11:53 +00:00
Cosimo Lupo
191a036f26
colorLib: add buildCOLR and buildCPAL 2020-02-17 12:11:51 +00:00