Cosimo Lupo
4dcc7f83d2
otTables: add Paint.traverse method
...
paint graph traversal mostly adapted from rsheeter's https://github.com/googlefonts/nanoemoji/pull/233
2021-02-15 11:12:16 +00:00
Cosimo Lupo
4036512a27
C_O_L_R_: factor out method to convert v0 layer records to dict of list
...
we'll need that when we subset the COLRv0 portion of a COLRv1 table
2021-02-15 11:12:16 +00:00
rsheeter
404072ee99
Fix descriptions in Lib/fontTools/ttLib/tables/otData.py
...
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
2021-02-15 10:42:59 +00:00
rsheeter
7abd234929
Update tests for new formats
2021-02-15 10:42:59 +00:00
rsheeter
2df3fed98a
Prevent otConverters from ignoring the 'template' type when field name is also a type
2021-02-15 10:42:58 +00:00
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
ec77db3619
Update Lib/fontTools/colorLib/builder.py
...
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
2021-02-12 10:02:08 -08:00
Simon Cozens
4fb666fee9
Remove tautology
2021-02-12 12:43:58 +00:00
Simon Cozens
1c259eee5f
Let instances optionally be InstanceDescriptors
...
Because if you've got an AxisDescriptor, you've probably got one of
those as well...
2021-02-11 16:07:05 +00:00
Simon Cozens
285f861e45
Localize instance subfamily name too.
2021-02-11 16:05:02 +00:00
Simon Cozens
d470ea4870
Typo
2021-02-11 15:53:35 +00:00
Simon Cozens
04f04474fd
Reformat with black for ease of further maintenance
2021-02-11 15:49:21 +00:00
Simon Cozens
4a8617fc92
New setAvar method
2021-02-11 15:46:05 +00:00
Simon Cozens
731f6a3107
Take AxisDescriptor (or objects conforming to its interface) in addFvar
2021-02-11 15:44:54 +00:00
Simon Cozens
8a58225e6d
Typo
2021-02-11 15:27:40 +00:00
Simon Cozens
c51c61f436
Remove py23isms
2021-02-11 15:15:35 +00:00
Simon Cozens
9e03da03da
Support localised axis names
2021-02-11 14:09:41 +00:00
Simon Cozens
567aadcc72
Document setupFvar
2021-02-11 14:08:36 +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
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
4b17301321
unbuilder: get Format attribute directly from the Paint instance
2021-02-04 12:24:13 +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
Cosimo Lupo
a3d13abcff
otData: fix typo, add comments
2021-02-04 11:32:22 +00:00
justvanrossum
f416a5cb17
fix Vector division
2021-02-03 20:24:04 +01: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
56df97b5f2
Prohibit non-functional "sub A B by NULL"
2021-02-03 14:16:57 +00:00
Simon Cozens
d1e85cb888
Allow 'sub X by NULL;' sequence to delete a glyph
2021-02-03 14:12:46 +00:00
Cosimo Lupo
728258d66f
Merge pull request #2166 from fonttools/fb-colr-glyphMap
...
fontBuilder: pass glyphMap to buildCOLR to sort base records by GID
2021-02-01 12:52:24 +00:00
Cosimo Lupo
8343468689
fontBuilder: pass through version and varStore parameter to buildCOLR
2021-02-01 11:59:24 +00:00
Cosimo Lupo
85c450b565
fontBuilder: pass glyphMap to buildCOLR to sort base records by GID
...
COLR Base glyph records must be sorted by glyph index. The buildCOLR
function has an optional glyphMap parameter that maps from glyph names
to glyph indices (as returned from TTFont.getReversedGlyphMap()).
FontBuilder knows all that so it should pass it on to colorLib.
2021-02-01 11:51:39 +00:00
Nikolaus Waxweiler
a3acb1426b
Remove py23 import
2021-01-29 22:23:27 +00:00
Nikolaus Waxweiler
8612319487
Bump version: 4.19.1 → 4.19.2.dev0
2021-01-28 17:06:32 +00:00
Nikolaus Waxweiler
b0278cf846
Release 4.19.1
2021-01-28 17:06:32 +00:00
Nikolaus Waxweiler
52e3e03ed9
An off-curve should stay off even with flags
2021-01-28 16:30:23 +00:00
Cosimo Lupo
822d3bf261
plistlib: remove unused 'type: ignore' comment to appease mypy
2021-01-25 17:42:19 +00:00
Cosimo Lupo
d47250dd15
Bump version: 4.19.0 → 4.19.1.dev0
2021-01-25 17:36:42 +00:00
Cosimo Lupo
f8283bda7e
Release 4.19.0
2021-01-25 17:36:42 +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
Cosimo Lupo
81fa5b5265
Merge pull request #2137 from fonttools/x-mac-encodings-errors
...
codecs: handle errors different from 'strict' for extended mac encodings
2021-01-20 11:21:43 +00:00
Cosimo Lupo
c9c30fa51d
Merge pull request #2153 from fonttools/paint-colr-layer-tree
...
COLRv1: support unlimited paints as 255-ary tree of PaintColrLayers
2021-01-20 11:20:26 +00:00
Tom Archer
9712407054
Change TypeError to ValueError
2021-01-20 11:19:43 +00:00