Cosimo Lupo
dfec4abf6d
glyf: use 'round' parameter in _getCoordinatesAndControls
...
as Behdad suggested in review
2023-06-08 11:47:47 +01:00
Cosimo Lupo
5c0f05cc42
allow to pass 'round' parameter in ttGlyphPen, optimize for noRound
2023-06-08 11:41:07 +01:00
Cosimo Lupo
86777525a6
drop oncurve if it's impliable either before OR after rounding
...
ofter the rounding gives us an opportunity to make an oncurve impliable, for points that were not equidistant become so after round, so why not take it!
2023-06-07 18:13:58 +01:00
Cosimo Lupo
1ca554332c
_getCoordinatesAndControls: make sure coords are rounded toInt() as gvar expects
...
ufo2ft will no longer send varLib already-rounded master glyf tables (to give it an opportunity to compute implied oncurves on the pre-rounded coords) so when retrieving coordinates off the glyf table in order to compute gvar deltas we have to round
2023-06-07 18:05:48 +01:00
Cosimo Lupo
0761508510
must update start = last + 1 in dropImpliedOnCurvePoints
...
Fixes #3155
2023-06-06 17:01:40 +01:00
Cosimo Lupo
5b93100616
also check endPtsOfContours in dropImpliedOnCurvePoints
...
as per review https://github.com/fonttools/fonttools/pull/3147#discussion_r1214708207
Also, don't do same work multiple times when dropping points from flags/endPtsOfContours arrays since these are supposed to be the same for all interpolatable glyphs
2023-06-05 12:11:17 +01:00
Cosimo Lupo
6a276d9f6a
dropImpliedOnCurvePoints: raise if incompatible, skip empty/composites
2023-06-02 13:51:28 +01:00
Cosimo Lupo
3b62811b63
have dropImpliedOnCurvePoints return the set of point indices useful for testing
2023-06-01 18:21:59 +01:00
Cosimo Lupo
e19871981d
add docstring to dropImpliedOnCurvePoints function
2023-06-01 16:49:30 +01:00
Cosimo Lupo
b7f4e9b83e
move dropImpliedOnCurvePoints function to glyf table module
...
so it can be used by client code on multiple glyf Glyph objects regardles of TTGlyphPen
2023-06-01 16:49:29 +01:00
Ben Kiel
d11a67010f
privData needs to pad with bytes not str
2023-05-25 10:30:28 -05:00
Tim Maffett
61ca53ab10
fix ttx split tables option to work on source files which have been url encoded and contain the '%' character
2023-04-28 17:07:44 -07:00
Jens Kutilek
85c80be6b6
Fix missing composite instructions in ttx ( #3092 )
...
* Fix calculation of haveInstructions
* Add test
2023-04-25 16:21:24 +02:00
Cosimo Lupo
cb5aa96702
add missing __main__.py file to ttLib package, plus some tests
...
Fixes https://github.com/fonttools/fonttools/issues/17
2023-04-24 11:22:53 +01:00
Just van Rossum
56b543826c
re-wrap
2023-04-18 14:38:50 +02:00
Just van Rossum
82441262e7
Update link to Apple doco
2023-04-18 14:37:34 +02:00
Cosimo Lupo
3615b565ca
sbixGlyph: don't use imageData for empty glyphs with graphicType=None
...
Fixes https://github.com/fonttools/fonttools/issues/3059
2023-03-27 15:23:13 +01:00
Cosimo Lupo
4543910367
[ttFont] fail when input is not seekable and lazy=True
...
the SFNTReader expects the input file to be seekable, and it already rewinds the file with file.seek(0) to get to the sfnt table directory. Thus, if TTFont is loaded with an unseekable file object and lazy=True, we raise a TTLibError requiring one to either pass a seekable input file, or to not set lazy=True (in which case the input is loaded in a seekable BytesIO)
Fixes https://github.com/fonttools/fonttools/issues/3052
2023-03-21 18:15:01 +00:00
Behdad Esfahbod
05872d6878
Merge pull request #2679 from fonttools/avar2
...
Avar2
2023-03-15 11:56:30 -06:00
Behdad Esfahbod
1deed38b8d
[avar2] Add compile test
2023-03-14 14:09:32 -06:00
Jens Kutilek
032616b106
Revert black formatting of inline instruction docs ( #3037 )
...
* Revert black formatting of inline instruction docs
* Ignore block when formatting
* Format instruction list with spaces
2023-03-14 16:48:21 +01:00
Jens Kutilek
f1a75bacb2
Handle string input to Program.fromAssembly() ( #3038 )
...
* Add tests for fromAssembly() output (#3036 )
* Handle string input to fromAssembly() (Fixes #3036 )
* Fixups suggested by @anthrotype
* Add some more typing annotations
* Program.assembly always returns List[str] now
* Add annotation for bytecode
* Move code from setter to fromAssembly
* Remove property
* Fix attribute names
2023-03-14 14:51:16 +01:00
Cosimo Lupo
580e3b3b50
otTables: forgot to actually import TTLibError ugh
2023-03-10 19:22:58 +00:00
Behdad Esfahbod
85036d5d83
[avar2] Revert unneeded change to VarIdxMap
...
We don't use VarIdxMap anymore.
2023-03-10 11:36:31 -07:00
Cosimo Lupo
3c9aa76893
Merge pull request #3027 from fonttools/colr-clipboxes
...
[COLRv1] Add method to automatically compute ClipBoxes, w/ optional quantization
2023-03-10 15:43:35 +00:00
Cosimo Lupo
c15e77cbc9
ot-spec says skewX angle should be counter-clockwise so we must negate
...
Transform.skew method assumes skewX angle goes clockwise.
verified using test_glyphs-glyf_colr_1.ttf test font from googlefonts/color-fonts repo.
Will add that to the tests.
2023-03-10 13:16:05 +00:00
Cosimo Lupo
55cc41a24e
[otTables] implement Paint.getTransform, Paint.computeClipBox & COLR.computeClipBoxes
...
This for now only works for static COLR table, not variable.
2023-03-10 13:16:04 +00:00
Cosimo Lupo
217742cc44
Merge pull request #3032 from fonttools/getGlyphID-KeyError
...
ttFont.getGlyphID should raise KeyError on missing glyphs
2023-03-10 12:11:33 +00:00
Cosimo Lupo
b137fd9616
ttFont: raise KeyError from getGlyphID instead of returning None
...
Fixes #3030
2023-03-10 11:38:55 +00:00
Guillaume Ayoub
b2c75bede4
Fix glyph compilation code
2023-03-10 11:34:16 +01:00
Behdad Esfahbod
e9e55b29f7
chmod otData.py
2023-03-08 13:19:51 -07:00
Cosimo Lupo
17f431b9c2
[otTables] switch to generic table traversal for Paint.traverse
2023-03-08 19:19:50 +00:00
Cosimo Lupo
7433c5dbb9
[otTraverse] allow to use custom callback to iterate over subtables
2023-03-08 19:13:48 +00:00
Behdad Esfahbod
b6acb83920
[avar2] Fix fromXML a bit
2023-03-08 11:44:23 -07:00
Behdad Esfahbod
90dd0685a4
[avar] black
2023-03-08 11:24:26 -07:00
Behdad Esfahbod
43b16df8db
[avar] Update test expectations
2023-03-08 11:10:07 -07:00
Behdad Esfahbod
6c35a5b65c
[avar2] Always set Version during compile
2023-03-08 11:04:52 -07:00
Behdad Esfahbod
06c725388a
[avar] Fix a few tests
2023-03-08 11:02:52 -07:00
Behdad Esfahbod
564dddced2
[avar2] Fix fromXML crash
2023-03-08 10:56:45 -07:00
Behdad Esfahbod
c8d32f2bb1
[avar2] Use DeltaSetIndexMap instead of VarIdxMap
2023-03-08 10:56:07 -07:00
Behdad Esfahbod
8dfad13288
[avar2] Implement toXML
2023-03-08 09:48:32 -07:00
Behdad Esfahbod
2b5686205e
[avar] Support previous API in compile/decompile
...
Using the otData mechanism with handcoded shim.
2023-03-08 09:29:58 -07:00
Behdad Esfahbod
fd822a2602
Merge branch 'main' into avar2
2023-03-07 11:21:20 -07:00
Behdad Esfahbod
6ba1302ce4
black
2023-03-07 11:19:22 -07:00
Behdad Esfahbod
501353f3df
[VarComposites] Flag rename
2023-03-06 13:10:09 -07:00
Cosimo Lupo
15b450e4a6
[ttx] support reading font/xml file from standard input as '-'
...
Fixes https://github.com/fonttools/fonttools/issues/3019
2023-03-03 14:13:06 +00:00
Nikolaus Waxweiler
54d6aaffb6
Guard against a ZeroDivisonError
...
The code was copied from ufo2ft.
2023-03-01 19:52:43 +00:00
Johannes Neumeier
29f980135a
Clean up and NotImplemented as proper return value
2023-02-27 09:31:13 +02:00
Johannes Neumeier
f52b3da721
Make NameRecord comparison not fail on encoding errors #3006
2023-02-24 15:58:53 +02:00
Behdad Esfahbod
9e40409094
[woff2] Support cubic curves as untransformed glyph table
2023-02-21 13:01:49 -07:00