1766 Commits

Author SHA1 Message Date
rsheeter
f1ecccbbb8
Begin updating for static vs variable versions of COLR v1 Paint 2021-02-15 10:42:55 +00:00
rsheeter
5316ae4b8c Add test to expose missed otRound + fix 2021-02-12 20:23:06 -08:00
rsheeter
0353c809cd Update COLR build fns per review feedback 2021-02-12 10:02:08 -08:00
rsheeter
cf4a4087be Generic build fns 2021-02-10 09:40:37 -08:00
Simon Cozens
587b4868cc
Merge pull request #2179 from simoncozens/document-ttglyphstuff
Document expected arguments for _TTGlyphSet, _TTGlyph and TTGlyphPen
2021-02-08 12:29:45 +00:00
Simon Cozens
9cb126b10a Document expected arguments for _TTGlyphSet, _TTGlyph and TTGlyphPen 2021-02-08 11:30:39 +00:00
Cosimo Lupo
df672a7ae4
move PaintFormat enum outside of Paint class nested scope
When a TTFont is loaded with lazy=True, the otTables are only loaded upon BaseTable.__getattr__
when the requested attribute is not found in the instance __dict__.
Since the Paint.Format enum was defined at class level, every Paint instance, even when loaded
lazily, will have a 'Format' attribute and the magic decompile-on-missing-attribute will not
trigger, since the class attribute will be returned when the instance is missing one.

For this reason, and to not add further special cases, it's better to simply move this Paint.Format
enum class outside to the module level scope, and rename it PaintFormat.
2021-02-05 12:11:43 +00: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
Nikolaus Waxweiler
52e3e03ed9 An off-curve should stay off even with flags 2021-01-28 16:30:23 +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
Seth Michael Larson
d5353a4085
Switch from brotlipy to brotlicffi for PyPy support 2020-12-01 19:37:02 -06: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
6c752f677f
rename Paint{ColorGlyph,ColrSlice} 2020-10-27 19:15:50 +00:00
Cosimo Lupo
d5e645a3c9
define Table.writeNullOffset() in subclasses; add comment as per review feedback 2020-10-27 18:35:36 +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
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
Cosimo Lupo
c7e3a692e1
otBase: support FormatSwitchingBaseTable with uint8 Format type 2020-10-08 12:39:56 +01:00
Cosimo Lupo
d60d84d3fc
otBase/otConverters: add support for 3-byte offsets 2020-10-08 12:39:54 +01:00
Cosimo Lupo
7f9462dfa6
compare paths independently of contour order
the order of contours modified by Skia is not stable and may change. So when we compare the original and the modified paths, we compare the paths as unordered sets of contours.

The order of contours doesn't produce any visible difference, but we try to keep the changes to the minimum here to avoid unnecessary diffs
2020-09-30 13:40:01 +01:00
Cosimo Lupo
66a0d91bf9
remove hinting from all glyphs, whether overlaps are removed or not 2020-09-30 13:36:28 +01:00
Cosimo Lupo
e94098606b
log modified glyps 2020-09-30 13:35:05 +01:00
Cosimo Lupo
7b9da7602c
skip empty paths with no contours
https://github.com/fonttools/fonttools/pull/2068#pullrequestreview-498472660
2020-09-29 16:24:17 +01:00
Cosimo Lupo
e1ad83add7
minor edit to comment [skip ci] 2020-09-29 14:44:51 +01:00
Cosimo Lupo
da439c7c57
decompose composites only if components intersect; let pathops.PathPen decompose components
requires https://github.com/fonttools/skia-pathops/pull/32
2020-09-29 14:14:55 +01:00
Cosimo Lupo
015d8265d2
use pathops.simplify() and remember if original path direction
pathops.simplify() returns a copy so we don't need to make a copy ourselves.

'clockwise' option is defined in https://github.com/fonttools/skia-pathops/pull/31
2020-09-27 17:31:30 +01:00
Cosimo Lupo
0ceb146196
process simple glyphs before composites
to avoid decomposing only because a component's base glyph contains overlaps.
2020-09-27 17:29:25 +01:00
Cosimo Lupo
2bcc103c36
move it to ttLib.removeOverlaps module 2020-09-23 19:13:58 +01:00
Simon Cozens
a18b6bfb6c
Merge pull request #2052 from simoncozens/fealib-debug
feaLib source debugging
2020-09-17 20:13:23 +01:00
Simon Cozens
7135255d4a Style nits 2020-09-11 09:35:45 +01:00
Simon Cozens
95a941ec15 Re-case debug info module 2020-09-11 09:31:07 +01:00
Simon Cozens
af4f1f6d6e Prefer module constant to hard-coded string for Debg table key 2020-09-10 16:00:06 +01:00
Caleb Maclennan
221fa07c3b
Default checkChecksums to off for WOFF2 Reader 2020-09-10 16:41:30 +03:00
Caleb Maclennan
705b9663d2
Default checkChecksums to off for SFNT Reader 2020-09-10 16:41:30 +03:00
Caleb Maclennan
7e3c4acfde
Use 0 not False to disable checkChecksums as documented and used
While False does get the job done, the value is not always treated as
a boolean. It is overloaded so that 1 or greater is True, but more than
1 has a different meaning than 1. Hence usage should always be as an
integer as documented so that it's clear(er) this isn't just an on/off
toggle.
2020-09-10 16:41:30 +03:00
Simon Cozens
02c305c2fc Serialize JSON object before writing to XML 2020-09-10 13:22:33 +01:00
Simon Cozens
4e70b30eb0 Ensure LookupCount is processed 2020-09-10 08:29:15 +01:00
Simon Cozens
98803b7bf8 Reformat, tidy from review comments 2020-09-09 19:56:55 +01:00
Simon Cozens
41c1dcce1c Tidy up as per review 2020-09-09 19:56:44 +01:00
Simon Cozens
4cddc38263 Use a named tuple, tidy ttx dump code 2020-09-09 19:56:05 +01:00
Just van Rossum
9064e53c7a
Add registry for custom table packer/unpacker classes (#2055)
* Add custom table packer/unpacker registry

* fix documentation for getTableClass(): it will never return None

* add unregisterCustomTableClass(), mostly for testing
2020-09-09 11:35:06 +02:00
Simon Cozens
b548c5f2e1 Namespace debug output. 2020-08-25 20:22:54 +01:00
Simon Cozens
50e1105604 Parse Debg info in LookupList 2020-08-25 20:19:31 +01:00
Simon Cozens
aebb2e511c The long-threatened Debg table! 2020-08-25 14:06:14 +01:00