New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support new AFDKO variable layout syntax #2228
Conversation
https://twitter.com/simoncozens/status/1373175391133655041 has a visual demo :) |
db7bbdb
to
7a69fb1
Compare
OK, something odd seems to have happen to self.expect_ttx(font, self.getpath("%s.ttx" % name))
# Check that:
# 1) tables do compile (only G* tables as long as we have a mock font)
# 2) dumping after save-reload yields the same TTX dump as before
for tag in ('GDEF', 'GSUB', 'GPOS'):
if tag in font:
data = font[tag].compile(font)
font[tag].decompile(data, font)
self.expect_ttx(font, self.getpath("%s.ttx" % name)) the first TTX is correct, but after compile/decompile roundtripping, additional comments for --- /Users/simon/others-repos/fonttools/Tests/feaLib/data/variable_conditionset.ttx
+++ /var/folders/js/26vkgd8s5x15c5kwbhq2c2jw0000gn/T/tmpp1m8cmke/tmp1.ttx
@@ -39,10 +39,8 @@
</LookupList>
<FeatureVariations>
<Version value="0x00010000"/>
- <!-- FeatureVariationCount=1 -->
<FeatureVariationRecord index="0">
<ConditionSet>
- <!-- ConditionCount=1 -->
<ConditionTable index="0" Format="1">
<AxisIndex value="0"/>
<FilterRangeMinValue value="0.625"/>
@@ -54,7 +52,6 @@
<SubstitutionRecord index="0">
<FeatureIndex value="0"/>
<Feature>
- <!-- LookupCount=1 -->
<LookupListIndex index="0" value="0"/>
</Feature>
</SubstitutionRecord> Obviously I can't keep both tests happy. I'm not sure what to do about this. |
the meaning of that tests is, if you're building those FeatureVariations and Feature records, you need to make sure the |
I'm not exactly sure what would have changed in the meantime |
Got it, thank you. |
Please rebase again when you get a chance @simoncozens. I need a commit later in history. |
Previously otlLib was generating None if the values themselves were empty even if the value format was non-empty. This happened to work for compiling to binary since the compiler handles Value=None. But this was confusing varLib.merger module (as in when building variable fonts from such otlLib-built master GSUB/GPOS tables, without roundtripping to OTF/TTF binary first), because in varLib.merger, a None means "this master doesn't provide that info; skip it"; whereas in a PairPos table a None as generated by otlLib simply meant "all values are zero", which is different from "this master doesn't provide this value". This fixes that, such that ufo2ft can build variable-font without saving masters to binary. Part of googlefonts/ufo2ft#486
…ubst The format values for those are automatically handled in postRead/preWrite to choose optimal format. As such, don't write them in XML. Reduces noise. fonttools#2236 (comment)
This reverts commit fb0c60c.
b880ae1
to
4639015
Compare
Ack, messed this up. Will reopen. |
-> #2432 |
Implements the variable scalar and conditional feature format proposed in this AFDKO discussion: