140 Commits

Author SHA1 Message Date
Behdad Esfahbod
24eb3f7197 [otData] Fix DeltaValue repeat value
The "" marker is used when a custom converter expects a list.
For DeltaValues, we expect a list as a single value, not a list
to be enumerated in XML. So, None is appropriate here. Cryptic,
I know...

Fixes https://github.com/fonttools/fonttools/pull/3757
2025-01-30 13:52:03 +00:00
Behdad Esfahbod
973072b259 [Condition] Implement ConditionValue
Shift other Condition format numbers.

Implements
https://github.com/adobe-type-tools/opentype-spec-drafts/blob/main/condvalue_spec.md
2024-05-22 18:46:07 -06:00
Behdad Esfahbod
973dc5c9a7 [varc] Use Condition instead of ConditionSet
With more Condition formats.

df7dcc4618
https://github.com/harfbuzz/boring-expansion-spec/issues/147
2024-05-22 18:46:07 -06:00
Behdad Esfahbod
74f870f4ef [varc] Add ConditionSets 2024-05-22 18:46:07 -06:00
Behdad Esfahbod
668a40da38 [VARC] Pivot on design again
Just store the AxisIndices in a shared list.
Don't explicitly store numAxes.
2024-05-22 18:46:07 -06:00
Behdad Esfahbod
58bb96be91 [VARC] Use a DeltaSetIndexMap 2024-05-22 18:46:07 -06:00
Behdad Esfahbod
42a5fbdfdd [VARC] Redesign table
No spec yet. For results see:

https://github.com/harfbuzz/boring-expansion-spec/issues/103#issuecomment-1863533305
2024-05-22 18:46:06 -06:00
Behdad Esfahbod
c91984ef77 [VARC] Use sparse-regions in MultiVarStore
Might revert as the savings are small.
https://github.com/harfbuzz/boring-expansion-spec/issues/103#issuecomment-1861531669
2024-05-22 18:46:06 -06:00
Behdad Esfahbod
ec78b572c9 [MultiVarStore] Fix up XML read/write
Looks complete now.
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
0e9eff8990 Add MultiVarStore 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
aad01a9d85 [VARC] Towards XML 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
ef6903e097 [VARC] Start
Based on https://github.com/harfbuzz/boring-expansion-spec/issues/103#issuecomment-1856325577
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
e9e55b29f7 chmod otData.py 2023-03-08 13:19:51 -07:00
Behdad Esfahbod
90dd0685a4 [avar] black 2023-03-08 11:24:26 -07:00
Behdad Esfahbod
c8d32f2bb1 [avar2] Use DeltaSetIndexMap instead of VarIdxMap 2023-03-08 10:56:07 -07:00
Behdad Esfahbod
6ba1302ce4 black 2023-03-07 11:19:22 -07:00
Cosimo Lupo
6389385813
Merge branch 'main' into avar2 2022-10-28 16:38:33 -07:00
Cosimo Lupo
1dffbae240 support proposed PaintSweepGradient's angles with +1.0 (180°) bias
In the upcoming draft of COLR spec, PaintSweepGradient's startAngle/endAngle are encoded with a +1.0 bias to allow for representation of a full +360° positive angle. Normal F2Dot14-fraction-of-half-circle angles can only represent angles between -360 <= angle < +360

This is a breaking change and will need to be coordinated with rendering implementations (at least FreeType/Skia).
2022-08-15 12:52:28 +02:00
Behdad Esfahbod
058af5e8ca [avar] Add avar2 fields 2022-07-22 13:15:09 -06:00
Behdad Esfahbod
8e013d9406 [avar] WIP Move avar to otData 2022-07-22 13:15:09 -06:00
Cosimo Lupo
871ee3d527 otData: add 'VarIndexBase + {offset}' to description of all COLR variable fields 2022-06-21 17:27:11 +01:00
Cosimo Lupo
58ac5a9fd8 have ClipList and ClipBox format start at 1, not 0
b7e81fcbd6
2021-08-02 19:34:30 +02:00
Cosimo Lupo
800bf85b2f add ClipList.Format so we can bump when we finally get >16bit GIDs
https://github.com/googlefonts/colr-gradients-spec/issues/346
2021-07-29 15:35:08 +02:00
Cosimo Lupo
bee2c85f61 [colrv1] otData: define ClipList, ClipBox, etc. 2021-07-28 18:04:48 +02:00
Cosimo Lupo
29a2ebf813 omit default VarIndexBase
4294967295 (0xFFFFFFFF in decimal form) is not very memorable.
Still, using hex notation for all VarIndexBases would make the non-default values less readable (when interpreted as an index into the DeltaSetIndexMap array, decimal makes more sense).
Since 0xFFFFFFFF means 'no variation data', it makes sense to omit it from the ttx dump and write an empty <VarIndexBase/> element with no value.
We also allow to build Var tables without needing to pass "VarIndexBase": 0xFFFFFFFF in the source dict.
2021-07-23 17:27:57 +01:00
Cosimo Lupo
0eb27e9878 Remove and inline {Var,}ColorIndex 2021-07-23 17:27:57 +01:00
Cosimo Lupo
40897a1508 Define DeltaSetIndexMap table used for COLR.VarIndexMap
https://github.com/googlefonts/colr-gradients-spec/pull/316
2021-07-23 17:27:57 +01:00
Rod S
7225ac22a6 Update to reflect COLR v1 FWORD center and offset to transform 2021-07-06 17:47:56 +01:00
Cosimo Lupo
0e99474985 otData: reduce precision of specialized transforms, use F2Dot14 for all angles
https://github.com/googlefonts/colr-gradients-spec/pull/307 & https://github.com/googlefonts/colr-gradients-spec/pull/310
2021-07-06 17:47:56 +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
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
Zachary Scheuren
0434b1a917
Add feaLib support for STAT table 2021-02-25 17:16:01 +00:00
rsheeter
404072ee99
Fix descriptions in Lib/fontTools/ttLib/tables/otData.py
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
2021-02-15 10:42:59 +00:00
rsheeter
f1ecccbbb8
Begin updating for static vs variable versions of COLR v1 Paint 2021-02-15 10:42:55 +00:00
rsheeter
cf4a4087be Generic build fns 2021-02-10 09:40:37 -08:00
Cosimo Lupo
a3d13abcff
otData: fix typo, add comments 2021-02-04 11:32:22 +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
538528d5a1
COLRv1: Implement PaintTranslate
https://github.com/googlefonts/colr-gradients-spec/pull/163
2020-12-15 16:58:31 +00:00
rsheeter
d888526659 Hook up paint skew and rotate 2020-12-02 21:21:19 -08:00
rsheeter
4171e28f32 Update ttLib/tables to latest spec 2020-11-10 21:51:04 -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
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
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
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
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