1707 Commits

Author SHA1 Message Date
Cosimo Lupo
9876f3c5c0 address review comments 2021-07-29 15:06:16 +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
e8e2aa530b remove unused Variable{Float,Int} namedtuples from otTables/otConverters 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
Cosimo Lupo
60f0724144 remove wrapping around from Angle converter, let the struct.error propagate 2021-07-19 17:52:00 +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
bb4c3e27c3 otConverters: define Angle and VarAngle, fractions of half circle encoded as F2Dot14
to be used with PaintRotate, etc.
2021-07-06 17:47:56 +01:00
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
Garret Rieger
7f9e2c3808 sort shared tuples produced by Counter.most_common()
In python 3.7 and earlier most_common() sorts first by the item count and then arbitrarily in the event of ties. This can result in two identical instancing operations producing different binary results.
2021-06-30 17:00:59 -07: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
Eric Muller
e2d9919524 Address pull request comments 2021-06-01 07:16:53 -07:00
Eric Muller
add77ca3f7 Report error is post table version 2.0 is too small 2021-05-26 11:27:39 -07:00
Eric Muller
bb5d59300c Merge branch 'fonttools:main' into main 2021-05-25 09:46:42 -07:00
Behdad Esfahbod
7af43123d4 [otBase] Tiniest cleanup 2021-05-24 14:52:34 -06: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
Eric Muller
212bb30c26 Fix parsing of post tables version 2.0 (#2314) 2021-05-20 09:32:26 -07:00
Cosimo Lupo
616fc065e0 add deprecation warnings for old getPhantomPoints, etc. 2021-05-13 10:13:28 +01:00
Cosimo Lupo
3c98250dbd g_l_y_f: fix undefined name 'topSideBearing'
Fixes #2295
2021-05-13 10:12:46 +01:00
Cosimo Lupo
6adbf188e6
Merge pull request #2288 from fonttools/remove-overlaps-print-glyph-error
removeOverlaps: work around pathops.simplify error
2021-05-12 17:06:57 +01:00
Just van Rossum
31ab3aae0b
Merge pull request #2285 from fonttools/varStore-32bit
Improve otBase facilities / towards 32bit VariationStore
2021-05-08 17:10:17 +02:00
Behdad Esfahbod
f21091b6ff [otBase] Assert array.array('i').itemsize 2021-05-07 15:52:35 -06:00
Behdad Esfahbod
98e2bf5526 [varLib.builder] Document bit-tweedling
https://github.com/fonttools/fonttools/pull/2285#discussion_r628401241
2021-05-07 15:41:33 -06:00
Behdad Esfahbod
b8963256fd [otBase/otConverters] Add back array index to exception in writeArray()
db6171df14 (r628543432)
2021-05-07 15:31:53 -06: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
Cosimo Lupo
b0e24384c2 minor refactorings following review comment
https://github.com/fonttools/fonttools/pull/2288#discussion_r627907922
2021-05-07 09:49:40 +01:00
Cosimo Lupo
d4d3d95414 split simplify logic to separate func for easier unit-testing 2021-05-06 20:23:56 +01:00
Cosimo Lupo
84b851398b removeOverlaps: try rounding to ints before simplify to workaround skia bug
Fixes https://github.com/google/fonts/issues/3365

See https://bugs.chromium.org/p/skia/issues/detail?id=11958 for details
2021-05-06 14:16:01 +01:00
Eigi
1091ff5e05 #2289 fix for typo in typo in ttLib.tables._g_l_y_f.py 2021-05-06 14:33:57 +02:00
justvanrossum
747f9f49b7 fix struct vs array mismatch: for array 'l' is 8 bytes, not 4. I'm not 100% sure this is correct for all platforms. 2021-05-04 18:54:26 +02:00
Cosimo Lupo
e13b781526 removeOverlaps: print glyph name when pathops.simplify fails
Sometimes skia-pathops simplify may fail (for unknown reasons which I'm still trying to debug).
It's a good idea to know the name of the offending glyph
https://github.com/google/fonts/issues/3365
2021-05-04 17:08:59 +01:00
Behdad Esfahbod
802e3636bc [otConverters] Support read/write of 32bit VarStore
Part of https://github.com/fonttools/fonttools/issues/2279
2021-05-01 12:51:12 -06:00
Behdad Esfahbod
a2f34fdf82 [otConverters] Rename VarStore shortCount to wordCount in local variables 2021-05-01 12:45:03 -06:00
Behdad Esfahbod
7d85b77996 [otConverters] Minor in VarStore padding 2021-05-01 12:44:15 -06:00
Behdad Esfahbod
0b20c196d4 [otConverters] Implement writeArray for GlyphID 2021-05-01 12:41:45 -06:00
Behdad Esfahbod
bd648ea14d [otConverters] Use array read/write in VarIdxMapValue 2021-04-30 16:29:18 -06:00
Behdad Esfahbod
db6171df14 [otBase] Actually call conv.writeArray()
Huh. Somehow the writeArray() was never wired up. We lose the failing
array index in the exception, but is fine to me.
2021-04-30 16:28:28 -06:00
Behdad Esfahbod
81ca053039 [otBase] Add array reader/writer for UInt24 2021-04-30 16:28:08 -06:00
Behdad Esfahbod
a8af308d70 [otConverters] Use array-writers for ItemVariationStore payload 2021-04-30 15:59:03 -06:00
Behdad Esfahbod
36dd271cd5 [otBase/otConverters] Add array-writers for int types 2021-04-30 15:58:45 -06:00
Behdad Esfahbod
1fd2a44bbf [otBase] fix array-reader to return list, not array.array
Was not noticed because it was for the most part unused.
2021-04-30 15:57:53 -06:00
Behdad Esfahbod
2496dcf9cc [otConverters] Add array readers to int converters 2021-04-30 15:41:25 -06:00
Behdad Esfahbod
1163fe68ff [otConverters] Use array readers when reading ItemVariationStore payload 2021-04-30 15:26:49 -06:00
Behdad Esfahbod
df0d6bbadf [otBase] Add array version of various int readers 2021-04-30 15:26:32 -06:00
Behdad Esfahbod
9959916c64
Merge pull request #2275 from fonttools/subset-device
[subset] Fix hint-dropping
2021-04-22 12:37:48 -06:00
Behdad Esfahbod
830cff6253 [ttLib] Add Value.getEffectiveFormat()
This ignores 0/None values that don't need to be encoded.
2021-04-21 14:10:27 -06:00
Garret Rieger
e0f1c15ad0 Include record size adjustment. 2021-04-21 12:15:29 -07:00