1977 Commits

Author SHA1 Message Date
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
Behdad Esfahbod
51a76e319e [glyf] Add old setCoordinates, getCoordinatesAndControls, getPhantomPoints
https://github.com/fonttools/fonttools/pull/2266
2021-04-14 14:36:35 -06:00
Behdad Esfahbod
a756bb01ab [glyf] Prefix setCoordinates, getCoordinatesAndControls, getPhantomPoints
Will add old name with old API next.
2021-04-14 14:09:40 -06:00
Behdad Esfahbod
24140e154e [glyf] Add default=None to glyf.get() 2021-04-14 13:36:07 -06:00
Behdad Esfahbod
d12d7fbb75 [glyf] Remove unused code
Also simplify bounds check.
2021-04-13 15:13:00 -06:00
Behdad Esfahbod
15c34e9ba9 [glyf] Add .get() which is like __getitem__() but returning None if not found
And use it in a couple places.
2021-04-13 15:06:25 -06:00
Behdad Esfahbod
75ef521fd0 [gvar] Reduce TTFont.__getitem__() calls 2021-04-13 14:45:40 -06:00
Behdad Esfahbod
3cbbc25d29 [glyf] Remove useless assert in setCoordinates() 2021-04-13 13:50:01 -06:00
Behdad Esfahbod
34b5ff623c [varLib] Optimize getPhantomPoints()
To reduce calling TTFont.__getitem__ many times per glyph!
2021-04-13 13:49:12 -06:00
Behdad Esfahbod
ddf2f0369b [glyf] Remove useless assert in getPhantomPoints() 2021-04-13 13:27:03 -06:00
Behdad Esfahbod
ee5ecd19d7 [varLib/glyf] Remove fallback vertical phantom-points code
I suggested Cosimo add that code in
https://github.com/fonttools/fonttools/pull/1528

Upon further inspection now, that code is unnecessary and even wrong in
cases where different masters have different ascent, because that would
result in encoding variations for vertical phantom points, which will
be then either be unused or double-apply on top of ascent etc.
2021-04-12 18:28:01 -06:00
Behdad Esfahbod
dc0600c764 [TupleVariation] Fold call to hasImpact() into getUsedPoints()
Related:
https://github.com/fonttools/fonttools/issues/2263

Part of:
https://github.com/fonttools/fonttools/pull/2261
2021-04-09 13:36:29 -06: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
b3a9ef551a [GlyphCoordinates] Use double, not float, again
https://github.com/fonttools/fonttools/pull/2261#discussion_r609928776
2021-04-09 11:43:44 -06:00
Behdad Esfahbod
85c9102d47 [TupleVariation] Use Counter() instead of defaultdict() for sharedCoords 2021-04-09 09:23:34 -06:00
Behdad Esfahbod
f3f1628571 [TupleVariation] Comment 2021-04-08 19:47:28 -06:00
Behdad Esfahbod
1650c15b55 [TupleVariation] Minor shift more code into getUsedPoints() 2021-04-08 19:32:54 -06:00
Behdad Esfahbod
050b07d336 [TupleVariation] Optimize compileDeltas() 2021-04-08 18:24:13 -06:00
Behdad Esfahbod
78e9bc7b49 [TupleVariation] Optimize compilePoints()
Special-case "all points used" representation in the internal API.
2021-04-08 18:24:13 -06:00
Behdad Esfahbod
e0513cfee3 [TupleVariation] Avoid recompiling pointData
Pass them down to tv.compile().

Tests need to be updated for changed new internal tv.compile() API.
2021-04-08 18:22:00 -06:00
Behdad Esfahbod
7051829f75 [TupleVariation] Compile point set counts outside of key() 2021-04-08 17:42:10 -06:00
Behdad Esfahbod
683e898768 [TupleVariation] Optimize point-sharing 2021-04-08 17:36:58 -06:00
Behdad Esfahbod
f40e522ce9 [TupleVariation] Speed up case of useSharedPoints=False 2021-04-08 15:57:53 -06:00
Behdad Esfahbod
92bf782ef3 [TupleVariatin] Minor optimization of sharedPoints 2021-04-08 15:53:48 -06:00
Behdad Esfahbod
8dae627d3f [TupleVariation] Rewrite getUsedPoints() as list comprehension 2021-04-08 15:50:52 -06:00
Behdad Esfahbod
12c88cc3a4 [TupleVariation] Remove use of byteord() 2021-04-08 15:50:52 -06:00
Behdad Esfahbod
c88aab1544 [TupleVariation] Minor optimization in compileDeltaValues_() 2021-04-08 15:50:52 -06:00
Behdad Esfahbod
ea505154df [gvar] Avoid a copy in compileGlyph_() 2021-04-08 15:50:52 -06:00
Behdad Esfahbod
997b976e9a [TupleVariation] Rewrite assertion faster 2021-04-08 15:50:52 -06:00
Behdad Esfahbod
b811c3f3f3 [gvar] Remove use of bytesjoin() 2021-04-08 12:18:58 -06:00