Behdad Esfahbod
171670a15f
[instancer] Simplify a couple of things ( #2732 )
...
* [instancer] Simplify normalization
2022-08-15 11:47:09 -06:00
Behdad Esfahbod
41e6f60011
Merge pull request #2738 from fonttools/glyphset
...
TTVarGlyphset
2022-08-15 11:07:41 -06:00
Behdad Esfahbod
dc99ab6b3f
[ttGlyphSet] Address review comments
2022-08-15 11:06:51 -06:00
Cosimo Lupo
e3aaf59084
Merge pull request #2734 from fonttools/instancer-bug
...
[instancer] Fix bug in _instantiateFeatureVariations()
2022-08-15 13:59:41 +01:00
Behdad Esfahbod
125dbc64b5
[varLib.interpolatable] Use new ttGlyphSet var feature to open varfont
2022-08-14 12:08:12 -06:00
Behdad Esfahbod
13e592cadf
[instancer] Fix bug in _instantiateFeatureVariations()
...
Fixes https://github.com/fonttools/fonttools/issues/2733
2022-08-09 17:15:29 -06:00
Nikolaus Waxweiler
489eff6715
[varlib.build_many] Pass on colr_layer_reuse
2022-08-08 14:06:49 +01:00
Behdad Esfahbod
68b0509711
[varLib.AligningMerger] Try harder to make it work as a standalone merger
2022-08-04 13:22:00 -06:00
Behdad Esfahbod
287ac43212
[varLib.AligningMerger] Make it work as a standalone merger
2022-08-04 12:30:44 -06:00
Behdad Esfahbod
21d22ae30f
Merge pull request #2716 from fonttools/interpolatable-opener
...
Interpolatable opener
2022-07-29 14:42:58 -06:00
Behdad Esfahbod
c1dc2f3c81
Merge pull request #2711 from fonttools/iup-cython
...
Compile a couple of modules with Cython when available
2022-07-29 11:21:47 -06:00
Behdad Esfahbod
3e6b9c8c08
[varLib.interpolatable] Open .glyphs files as well
2022-07-29 11:19:27 -06:00
Behdad Esfahbod
10aecc029a
[varLib.interpolatable] Support reading .designspace file
2022-07-29 11:19:22 -06:00
Cosimo Lupo
c6b2ba5286
[varLib.merge] fix NameError: 'NotANone'
...
Fixes https://github.com/fonttools/fonttools/issues/2712
2022-07-29 13:05:26 +02:00
Behdad Esfahbod
aa509b6df2
[varLib.interpolatable] Fix mix of space & tab
2022-07-28 14:01:15 -06:00
Behdad Esfahbod
5d9677038b
[varLib.iup] Compile with Cython when available
...
Even with no annotations, makes it ~35% faster.
2022-07-28 12:35:02 -06:00
Just van Rossum
8c19828d7e
[varLib.merge] Fix for error during error reporting ( #2689 )
...
* work around error during error reporting, as reported in #2688
* Use stack[-1] (the table tag) as per feedback
2022-07-12 20:59:29 +02:00
Just van Rossum
1c8efee98d
fix typo in COLR merge
2022-07-07 16:00:43 +02:00
Cosimo Lupo
a08140dc76
[varStore/subset] correctly handle NO_VARIATION_INDEX when subsetting varidxes
...
otherwise GDEF/GPOS.remap_device_varidxes may fail with KeyError attempting to map a NO_VARIATION_INDEX
2022-07-06 17:29:00 +01:00
Cosimo Lupo
eab9aa5a22
instancer: use_NO_VARIATION_INDEX=False when optimizing {H,V}VAR VarStore
...
Same as we do in subsetter, see e01f643a8e
2022-07-06 16:36:05 +01:00
Nikolaus Waxweiler
ce38db6562
Merge pull request #2673 from daltonmaag/instancer-set-bits
...
Set RIBBI bits when cutting instances
2022-07-06 11:01:08 +01:00
Cosimo Lupo
2a07518b70
Merge pull request #2660 from fonttools/variable-colr
...
[varLib] add support for building variable COLR from set of master COLRv1 tables
2022-07-06 10:55:50 +01:00
Nikolaus Waxweiler
2cd4f7e688
Use NameID enum
2022-07-06 10:40:27 +01:00
Nikolaus Waxweiler
87bf2a866d
Update docstring
2022-07-06 10:37:22 +01:00
Cosimo Lupo
cdc7cc3cc4
COLR merger be cleverer and only deepcopy effectively reused layers
...
instead of blindly copying them all like in previous commit.
2022-07-05 20:37:54 +01:00
Cosimo Lupo
c27483fa54
[instancer] add --no-recalc-bounds CLI option
2022-07-05 19:02:21 +01:00
Cosimo Lupo
8a9f16d129
COLRVariationMerger: copy destination layers to ensure they are unique and can be modified in place
2022-07-05 17:53:39 +01:00
Nikolaus Waxweiler
e84bee9cd9
Set bits only after updating names
2022-07-05 16:10:15 +01:00
Nikolaus Waxweiler
2c773441cf
Remove logging
2022-07-05 16:09:37 +01:00
Nikolaus Waxweiler
16d899a2be
Apply RIBBI bits to all kinds of fonts
2022-07-05 15:45:44 +01:00
Cosimo Lupo
e5029801d2
support merging COLR masters with 'sparse' glyphsets or different layer count
...
There is no longer a requirement that all the masters have exactly the same base color glyphs as the default masters. Similarly, it's no longer required that all masters' LayerLists have the same total count of layers. It is sufficient that, for a base color glyph in the default master, a non-default master may (or may not) contain one with the same name and same effective number of layers (which in turn can be laid out differently in the respective LayerLists).
This provides greater flexibility when working with variable font project with sparse glyph sets.
2022-07-05 00:11:12 +01:00
Cosimo Lupo
5d52124e49
varLib.errors: allow to give extra context as to where an error occurs in the optional 'cause'
2022-07-04 18:52:20 +01:00
Cosimo Lupo
4b9f35dc2b
varLib.merger: subset self.ttfs to non-None (sparse) values in VariationMerger.mergeThings
2022-07-04 18:52:20 +01:00
Nikolaus Waxweiler
a3e14643a1
Set RIBBI bits when cutting instances
2022-06-30 18:56:03 +01:00
Cosimo Lupo
d85aa2d119
COLRVariationMerger: further optimize DeltaSetIndexMap
...
previously we only reused the VarIndexBase of a previously seen variable table when the current's varIdxes were _fully_ equal to one of the previous; now we also try to find a match anywhere in the accummulated list of self.varIdxes, including a partial match at the tail of the list.
2022-06-28 14:11:28 +01:00
Cosimo Lupo
c397764720
COLRVariationMerger: implement reuse of VarIndexBase between tables with same varIdxes
...
When multiple variable tables refer to the same delta-sets they can now share the same VarIndexBase so the resulting DeltaSetIndexMap is a bit smaller.
For simplicity, we only reuse VarIndexBase when variable tables fully share (ie. same, and same number of) varIdxes; potentially we could reuse subsets of varIdxes (e.g. a VarColoStop.Alpha has a +0.5 delta, and later on elsewhere a PaintVarSolid.Alpha has a similar +0.5 delta; the latter could have a VarIndexBase that reuses an existing DeltaSetIndexMap entry for the former), but for now this I think is good enough.
2022-06-27 17:17:32 +01:00
Cosimo Lupo
99a754a48e
varLib/merger.py: (minor) rename self.varTables => self.varTableIds
2022-06-27 15:54:51 +01:00
Cosimo Lupo
f02593cf1a
COLRVariationMerger: fix logic in convertSubTablesToVarType
...
Before we were too greedy in the way we converted subtables to VarType. E.g. If a PaintTransform wrapping a PaintRadialGradient contained variations in the Affine2x3, we would incorrectly convert also the gradient's ColorLine (and ColorStops) to VarColorLine, VarColorStop, etc. (even if the gradient was not variable!). Instead we want skip traversing a given subtable including its children when the predicate doesn't match.
2022-06-24 18:14:58 +01:00
Cosimo Lupo
a53a235302
varLib.merger: set Paint.Format to int(PaintFormat)
...
for consistency with the way tables are decompiled from binary data
2022-06-24 11:36:58 +01:00
Cosimo Lupo
7ab7940761
varLib: simplify a bit following varStore.py recent changes
...
#2662
2022-06-24 10:20:48 +01:00
Cosimo Lupo
fcd2a67f52
Merge remote-tracking branch 'origin/main' into variable-colr
2022-06-24 10:16:51 +01:00
Behdad Esfahbod
e01f643a8e
[varLib.varStore] Support NO_VARIATION_INDEX in optimizer & instancer
...
Fixes https://github.com/fonttools/fonttools/issues/2211
2022-06-23 12:01:20 -06:00
Behdad Esfahbod
cac7241514
[varLib.varStore] Add NO_VARIATION_INDEX
...
Part of https://github.com/fonttools/fonttools/issues/2211
2022-06-23 12:01:20 -06:00
Behdad Esfahbod
e917c43ca9
[varLib.varStore] Add operator __bool__ and use it
...
Part of https://github.com/fonttools/fonttools/issues/2211#issuecomment-790125437
2022-06-21 14:03:20 -06:00
Cosimo Lupo
9c0bc3814f
varLib: add --no-colr-layer-reuse option to disable rebuilding LayerList
2022-06-21 17:27:12 +01:00
Cosimo Lupo
00959d3132
varLib: build variable COLR table when master fonts contain COLRv1
2022-06-21 17:27:12 +01:00
Cosimo Lupo
e58c43d187
varLib.merger: add a COLRVariationMerger to merge multiple master COLRv1 into a variable COLR
2022-06-21 17:27:12 +01:00
Cosimo Lupo
bc8f1cfac4
varLib.errors: more informative message with unsupported/inconsistent formats
2022-06-21 17:27:12 +01:00
Cosimo Lupo
0cbdc8536b
[otBase/varLib.merger] don't recurse in ensureDecompiled, merger is already working recursively
2022-06-21 17:27:11 +01:00
Behdad Esfahbod
0d7d7d4e11
[varLib.iup] Rewrite force-set conditions & limit DP lookback length
...
This does two things:
Fixes forced-set computation, which was wrong in multiple ways.
Debugged it. Is solid now... Famous last words.
Speeds up DP time by limiting DP lookback length. For Noto Sans,
IUP time drops from 23s down to 9s, with only a slight size increase
in the final font. This basically turns the algorithm from O(n^3) into
O(n).
2022-06-20 17:09:36 -06:00