[varLib.featureVars] Buggy
See original GitHub issueFrom Just:
from pprint import pprint
from fontTools.varLib.featureVars import overlayFeatureVariations
rules = [
([{'abcd': (4, 9)}], {0: 0}),
([{'abcd': (5, 10)}], {1: 1}),
([{'abcd': (0, 8)}], {2: 2}),
([{'abcd': (3, 7)}], {3: 3}),
]
pprint(overlayFeatureVariations(rules))
-->
[({'abcd': (5, 7)}, [{0: 0}, {1: 1}, {2: 2}, {3: 3}]),
({'abcd': (7, 8)}, [{0: 0}, {1: 1}, {2: 2}]),
({'abcd': (4, 5)}, [{0: 0}, {2: 2}, {3: 3}]),
({'abcd': (3, 7)}, [{2: 2}, {3: 3}]),
({'abcd': (8, 9)}, [{0: 0}, {1: 1}]),
({'abcd': (8, 10)}, [{1: 1}])]
There is no rule vor (0, 3) in the overlayed ruleset.
Here’s another one:
rules = [
([{'abcd': (1, 9)}], {0: 0}),
([{'abcd': (8, 10)}], {1: 1}),
([{'abcd': (3, 4)}], {2: 2}),
([{'abcd': (1, 10)}], {3: 3}),
]
pprint(overlayFeatureVariations(rules))
-->
[({'abcd': (3, 4)}, [{0: 0}, {2: 2}, {3: 3}]),
({'abcd': (8, 9)}, [{0: 0}, {1: 1}, {3: 3}]),
({'abcd': (8, 10)}, [{1: 1}, {3: 3}]),
({'abcd': (4, 8)}, [{0: 0}, {3: 3}]),
({'abcd': (1, 10)}, [{3: 3}])]
For an axis value of 2, both {0: 0} and {3: 3} should trigger, but only {3: 3} ends up in the overlayed list.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
addFeatureVariation doesn't work on a glyph that's also being ...
varLib.featureVars import addFeatureVariations inputTTF ... Any engine that only uses FeatureVariations with the rvrn feature is buggy.
Read more >instancer — fontTools Documentation - Read the Docs
If the input location specifies all the axes, the resulting instance is no longer 'variable' (same as using fontools varLib.mutator):.
Read more >NEWS.rst - platform/external/fonttools - Git at Google
[varLib] Improved error message when masters' glyph orders do not match (#1758,. #1759). - [featureVars] Allow to specify custom feature tag in ...
Read more >fonttools [python-library] - Occam :: Details
[varLib.merger] Fixed bug where VarLibMergeError was raised with ... [featureVars] Raise better error message when a script is missing the required default ...
Read more >python dataclass inheritance post init - elecbas.com
[featureVars] Added experimental module to build FeatureVariations #2734). ... [varLib.models] Fixed KeyError while sorting masters and there are no on-axis ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see the difference. What you are doing is to create one lookup per changeset. Whereas in the code, Just originally decided, to generate one lookup per input changeset and reference multiple lookups from each region. This is typically beneficial by not duplicating the lookup content multiple times. But in your case, combining is more compact. Let me think, we can probably find out what the optimal combination is and produce that…
I’m guessing that that just doesn’t do anything. Does it work?!