67 Commits

Author SHA1 Message Date
Behdad Esfahbod
2229607dd1 Black 2024-05-22 18:46:06 -06:00
Behdad Esfahbod
f73d6f2a6f [VARC] Fixups 2024-05-22 18:46:06 -06:00
Behdad Esfahbod
9cc3689fb1 [VARC] Towards drawing new design 2024-05-22 18:46:06 -06:00
Behdad Esfahbod
28520553f3 [VARC] Allow drawing same-name glyph 2024-05-22 18:46:06 -06:00
Behdad Esfahbod
44a32f8a2a Minor refactor 2024-05-22 18:45:28 -06:00
Behdad Esfahbod
950d39b9d3 [VARC] Finish drawing! 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
bbad70ef8a [VARC] bool(Vector) is useless... :( 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
4b6c574d54 [VARC] More towards drawing 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
0e52857ffe [VARC] Start drawing VARC glyphs 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
a30ebf0a2f Revert "Remove some more remnants of VarComposites in ttGlyphSet"
This reverts commit 98d30dcf45e71b4352d9bfe2fee6ce4bfa198248.
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
e9551c483a Remove some more remnants of VarComposites in ttGlyphSet
Going to re-add for VARC table.
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
bcd5e4c216 Rip out glyf1 VarComposites
In favor of separate VARC table.

ttGlyphSet does NOT yet know how to draw VARC table though.

The 9 failing tests are all VarComposite-related and need
to be updated with VARC equivalents eventually when we
add VARC support to subsetter and instancer.
2024-05-22 18:45:27 -06:00
Khaled Hosny
cf08265cd5 Black 2024-02-06 15:47:35 +02:00
Behdad Esfahbod
9afac79105 [lerp_recording] Make into a generator 2023-12-07 04:49:59 -07:00
Behdad Esfahbod
167e0cb646 [ttGlyphSet] Use lerp_recordings 2023-12-07 04:49:59 -07:00
Behdad Esfahbod
4f6c739181 Move LerpGlyphSet and lerp_recordings to more prominent places
Fixes https://github.com/fonttools/fonttools/issues/3361
2023-12-07 04:49:59 -07:00
Behdad Esfahbod
772dc549f3
[ttGlyphSet] Add option to not recalculate glyf bounds (#3348)
Avoids unnecessary work in the interpolator.
2023-11-21 12:06:57 -07:00
Cosimo Lupo
335a1e56ec re-run black v23.10 on all .py files 2023-11-03 10:25:15 +00:00
Behdad Esfahbod
a2ff670c43 [VarComposite] Adjust for RESET_UNSPECIFIED_AXES semantic change
https://github.com/harfbuzz/boring-expansion-spec/issues/81
2023-02-06 12:06:14 -07:00
Behdad Esfahbod
51d7524a23 Revert "[ttGlyphSet] Must deep copy var components when instantiating"
This reverts commit fe6f5bd14386d0a1f546d079f1ec38e4d2414fbf.

Better fix.
2023-02-03 15:22:10 -07:00
Just van Rossum
fe6f5bd143 [ttGlyphSet] Must deep copy var components when instantiating 2023-02-03 23:13:41 +01:00
Behdad Esfahbod
fcc4f379fb [ttGlyphSet] Don't apply lsb-xMin shift to components
This matches HarfBuzz, FreeType, and Windows.

Fixes https://github.com/fonttools/fonttools/issues/2981
2023-02-03 13:55:31 -07:00
Behdad Esfahbod
e374af919d [ttGlyphSet] Only decompose VarComposites on AttributeError
Keep NotImplementedError for clients to really say don't want it.
2023-02-03 13:35:09 -07:00
Behdad Esfahbod
249d9248eb [ttGlyphSet/VarComposite] Accept AttributeError as well 2023-02-03 08:59:32 -07:00
Behdad Esfahbod
4ce383f167 [ttGlyphSet] Consolidate two branches 2023-02-03 08:58:16 -07:00
Just van Rossum
bc19f42c0f [ttGlyphSet] fix indentation so it works for point pens, too 2023-02-03 16:36:40 +01:00
Behdad Esfahbod
69966aa5d7 [BasePen] Add addVarComponent() 2023-02-02 15:25:09 -07:00
Behdad Esfahbod
59418656a4 [VarComposite] Add VarTransform and use 2023-02-02 14:50:26 -07:00
Behdad Esfahbod
05da0ac1b5 [VarComposites] Handle missing transform attributes during drawing 2023-02-02 11:28:36 -07:00
Behdad Esfahbod
69d56c3104 [VarComposite] Use math.radians as per review 2023-02-02 10:58:58 -07:00
Behdad Esfahbod
f3f50393a8 [ttGlyph] Adjust contextmanager pattern 2023-02-02 10:52:31 -07:00
Behdad Esfahbod
0e9efae0d5 [VarComposite] Use contextmanager as per review 2023-02-01 14:17:24 -07:00
Behdad Esfahbod
63d355e37d [Tests/ttGlyphSet/VarComposite] Add test
And a bugfix.
2023-01-30 11:26:21 -07:00
Behdad Esfahbod
4310512f07 [ttGlyphSet/VarComposite] Add VarComponentFlags.RESET_UNSPECIFIED_AXES 2023-01-30 11:26:21 -07:00
Behdad Esfahbod
3b19719c5a [ttGlyphSet/VarComposite] Fixups
Renders fine now.
2023-01-30 11:26:20 -07:00
Behdad Esfahbod
3eeeae5b82 [ttGlyphSet/VarComposite] Fix rotation 2023-01-30 11:26:20 -07:00
Behdad Esfahbod
b85d1c7d35 [ttGlyphSet] Draw VarComposite glyphs
Still some bugs there.
2023-01-30 11:26:20 -07:00
Behdad Esfahbod
1c8741a2ca [glyf/VarComponent] Add setCoordinates 2023-01-30 11:26:20 -07:00
Behdad Esfahbod
8a2e918bae [glyf] Black 2023-01-30 11:26:20 -07:00
Just van Rossum
d0f4133df0 Fix arguments in calls to (glyf) glyph.draw() and glyph.drawPoints(); this fix also exposed a second bug, where lsb and tsb were not set; this fixes #2824 2022-09-20 09:00:35 +02:00
Just van Rossum
8fa79f3c68 Use ABC baseclass, instead of ABCMeta metaclass 2022-08-30 12:02:43 +02:00
Just van Rossum
a4f3cb1c98 drawPoints can have an implementation that calls draw using SegmentToPointPen 2022-08-30 12:00:50 +02:00
Just van Rossum
7ae37322cd make _TTGlyph an abstract base class, with draw and drawPoints abstract methods 2022-08-30 11:47:39 +02:00
Just van Rossum
6d2a9904c4 Add TTFont.normalizeLocation() as a public method. 2022-08-30 08:49:36 +02:00
Just van Rossum
0c68a5621a move normalization of location to TTFont 2022-08-30 08:49:36 +02:00
Just van Rossum
42a8d5cbdf no need for if expression 2022-08-30 08:49:36 +02:00
Just van Rossum
b818e1494f Refactor ttGlyphSet.py
- only differentiate between glyf and CFF/CFF2 implementations, not var vs non-var
- use collections.abc.Mapping to get a more consistent dict-like object with less code
- prefer HVAR metrics over gvar metrics
- move some responsibilities from the _TTGlyphSet objects to the _TTGlyph objects
- adjust some tests to the changes
2022-08-30 08:49:36 +02:00
Just van Rossum
8932ab427f Convert tabs to spaces 2022-08-29 19:28:46 +02:00
Behdad Esfahbod
24bd200b6e [ttGlyphSet-CFF] Cache instancer 2022-08-27 13:32:19 -06:00
Behdad Esfahbod
bcd637bd1a [ttGlyphSet-cff] Remove rounding 2022-08-27 12:20:15 -06:00