Just van Rossum
0d3ce2cafc
Use Vector in some places where it improves the clarity of the code ( #2206 )
...
* Use Vector in some places where it improves the clarity of the code
* add __all__ to vector.py
* turned some list comprehensions into generator expressions: there's no need for an intermediate list in these cases
* Add empty __slots__ to Vector, so we don't waste space on a __dict__.
* add some tests for segmentPointAtT
2021-03-04 15:32:45 +01:00
justvanrossum
44b7560fe5
move Vector to its own submodule, and rewrite as a tuple subclass
2021-02-27 19:54:53 +01:00
justvanrossum
2429a187fc
Revert ABC changes to Pens, fixes #2198
2021-02-26 20:18:37 +01:00
Marc Foley
52fec53d20
Drop nameID 25 if instantiating a static font
2021-02-26 10:32:38 +00:00
Marc Foley
a7913ef50e
Add test for Regular fallback
2021-02-26 10:32:38 +00:00
Cosimo Lupo
2be13d50ac
make instancer into a package dir and move all names-related funcs to submodule
...
move instancer tests to Tests/varLib/instancer directory
create instancer/__main__.py to make package executable
2021-02-26 10:31:30 +00:00
Marc Foley
0280eb36cc
Parametrize updateNameTable tests
2021-02-26 10:19:43 +00:00
Marc Foley
336e7827e7
Implement Cosimo feedback
2021-02-26 10:19:43 +00:00
Marc Foley
29e4ff987c
instancer: implement Cosimo feedback
2021-02-26 10:19:43 +00:00
Marc Foley
0bcbbfdbb5
instancer: reuse existing instantiateSTAT func
2021-02-26 10:19:43 +00:00
Marc Foley
9a72311d19
instancer: refactor updateNameTable
2021-02-26 10:19:43 +00:00
Marc Foley
b328475072
wip instancer: update uniqueID
2021-02-26 10:19:43 +00:00
Marc Foley
ce1d8a9955
instancer: Add axisDefaults to axisLimits
2021-02-26 10:19:43 +00:00
Marc Foley
69c8667982
instancer: sort axisValues so format 4 are dominant for constructing names
2021-02-26 10:19:43 +00:00
Marc Foley
b4b1ce3579
instancer: include attribute axisValues
2021-02-26 10:19:42 +00:00
Marc Foley
f89c01d2d7
instancer: only updateNames if axisValue with specified coord exists
2021-02-26 10:19:42 +00:00
Marc Foley
78f6c2ae75
instancer: add test for partial instance name
2021-02-26 10:19:42 +00:00
Marc Foley
b502471a08
wip instancer: support format 4 axisvalues
2021-02-26 10:19:42 +00:00
Marc Foley
b95607513c
WIP instancer: update static font nametable
2021-02-26 10:19:42 +00:00
Kamile Demir
29ff42d15f
Reusing otlLib buildStatTable() in feaLib
2021-02-25 17:16:02 +00:00
Zachary Scheuren
0434b1a917
Add feaLib support for STAT table
2021-02-25 17:16:01 +00:00
Nikolaus Waxweiler
f6a62e0db1
Merge pull request #2164 from fonttools/pen-maintenance
...
Pen maintenance
2021-02-22 10:26:39 +00:00
Nikolaus Waxweiler
839c57a50d
Remove some Python 2 vestiges from pen tests
2021-02-21 10:30:17 +00:00
Nikolaus Waxweiler
ab1883da1d
Turn AbstractPen and AbstractPointPen into ABCs plus typing
2021-02-21 10:20:37 +00:00
Denis Moyogo Jacquerye
537fabcee9
[feaLib] update tests for indented anchors
2021-02-18 19:19:18 +00:00
Simon Cozens
bac9a1cba3
Merge pull request #2185 from simoncozens/fontbuilder
...
fontBuilder improvements
2021-02-15 15:23:32 +00:00
Cosimo Lupo
09af39ab53
subset: donwgrade COLRv1 to v0 if all v1 glyphs are dropped
2021-02-15 11:58:56 +00:00
Cosimo Lupo
55c9a0a1ef
update subset_test.py using new COLRv1 dict format
2021-02-15 11:15:42 +00:00
Cosimo Lupo
056aba8e4a
prune unused CPAL palette entries after subsetting COLR glyphs
...
Fixes https://github.com/fonttools/fonttools/issues/2174
2021-02-15 11:15:42 +00:00
Cosimo Lupo
dda10e0f00
WIP: add test_subset_COLRv1
2021-02-15 11:12:16 +00:00
rsheeter
7abd234929
Update tests for new formats
2021-02-15 10:42:59 +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
Simon Cozens
3871537abd
Update test expectations; multilingual names got shared instead of duplicated
2021-02-12 12:11:51 +00:00
Cosimo Lupo
e542b60dde
colorLib: add generic TableUnbuilder, reverse of TableBuilder
2021-02-10 18:44:28 +00:00
rsheeter
cf4a4087be
Generic build fns
2021-02-10 09:40:37 -08: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
82c32cbf88
C_O_L_R_test: fix incorrect NumLayers
...
there's actually 3 LayerRecords defined in the COLR_V1_SAMPLE, not 4.
2021-02-05 10:36:12 +00:00
Cosimo Lupo
e20ccfcf9f
add unbuildPaintSweepGradient
2021-02-04 12:16:29 +00:00
Cosimo Lupo
22d290b06e
Merge remote-tracking branch 'origin/master' into colorLib-unbuilder
2021-02-04 12:09:30 +00:00
Cosimo Lupo
708cb9aef1
Merge pull request #2172 from fonttools/colr-sweep-gradient
...
COLRv1: add support for PaintSweepGradient
2021-02-04 11:47:34 +00:00
justvanrossum
f416a5cb17
fix Vector division
2021-02-03 20:24:04 +01:00
Cosimo Lupo
a7d145f027
update tests for PaintSweepGradient
2021-02-03 19:11:44 +00:00
Cosimo Lupo
93c23eaaf7
COLRv1: define new PaintSweepGradient, amend tests with new format numbers
2021-02-03 18:21:09 +00:00
Cosimo Lupo
8f66a1e813
COLRv1: add functions to un-build COLR otTables to raw dicts
...
This adds an unbuildColrV1 which does the inverse of colorLib.builder.buildColrV1.
Takes a LayerV1List and BaseGlypV1List and returns a map of base glyphs to raw data structures (list, dict, float, str, etc.).
Useful not only for debugging purpose, but also for implementing COLRv1 subsetting (where we need to drop whole chunks of paints which may be reused by multiple glyphs).
2021-02-03 16:47:59 +00:00
Simon Cozens
d1e85cb888
Allow 'sub X by NULL;' sequence to delete a glyph
2021-02-03 14:12:46 +00:00
Nikolaus Waxweiler
8569a8435f
Update Tests/ttLib/woff2_test.py
...
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
2021-01-28 16:35:36 +00:00
Nikolaus Waxweiler
52e3e03ed9
An off-curve should stay off even with flags
2021-01-28 16:30:23 +00:00
Cosimo Lupo
7db6b8aae5
Merge pull request #2155 from daltonmaag/add-verbose-error-for-classdefbuilder-add
...
Raise an exception when ClassDefBuilder attempts to add a duplicate glyph.
2021-01-25 17:19:21 +00:00
Tom Archer
be898ec6f9
Change ValueError to OpenTypeLibError
2021-01-20 14:30:49 +00:00