-
Notifications
You must be signed in to change notification settings - Fork 167
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
[buildcff2vf] unexpected behavior for non-interpolating glyph #1655
Comments
Now that I've been looking at the relevant fontTools code in the hope of mimicking its effects, I might be able to say a bit about this. Broadly speaking I agree that a glyph only defined in the default master should "work". That may require special alternative handling in the fontTools model code, or outside of that code to avoid instantiating a model in the first place. However, I suspect that the fact that things work when you add the glyph to any additional master is basically a coincidence. Before a certain point in fontTools development you needed to have at least one master on the edge of every axis. From what I can tell they changed that in order to support certain HOI cases where supplying those masters would be ugly, effectively by pretending that the default master was reproduced in those locations. It is a little strange that this hasn't been thought of/requested before, as it seems like something that would have come up. Maybe there's some way to request "special handling" that is implemented for glyf/loca but not CFF. We can check that. |
Adding a bit more context here in the hopes that it might lead to a faster resolution โฆ I originally asked @frankrolf about this issue after running in to it when adding some new glyphs in the default source of a project I'm working on. The curious thing is that before that, the project already had many other glyphs that only existed in the default source, and it had never been an issue before. And, in fact, I tried removing the new glyphs in the process of trouble shooting and was able to generate the variable font again, even though those older default-only glyphs were still in place. Of course as you might imagine I did lots of troubleshooting to see if it was something about the specific glyphs I was adding, but the only thing new that came from that exploration was that if I kept the glyphs in place but removed all the contours inside, the font would sometimes generate. After that point Frank made his more controlled test suite to recreate the issue, but I have a strange sense that there may be some other factors at play than it appears, otherwise โ as @skef said โ I would have expected the issue to come up before. |
I have a designspace like this:
2 axes, 9 sources, the middle source (๐) is my default.
I have one interpolating glyph (o), and a generic glyph (โฎ).
In my opinion, the most obvious approach for a generic glyph would be having it in the default source only.
However, in the case of this designspace, this approach fails:
I was curious what exactly goes wrong โ it turns out that having the generic glyph in any other source but the generic one will build a proper CFF2 VF. Also, any combination of same-glyph-in-two-sources will build the CFF2.
While this failure may have to do with my specific designspace setup (and some behind-the-scenes designspace shuffling), I think this smells like a bug.
Attached is a project which simulates all 45 possible scenarios (generic glyph in one or two sources) within this designspace, and attempts to build a CFF2 VF from it. Really, only the most obvious approach fails. ๐
Thanks to @nicksherman who ran into this issue IRL, and thus sparked this exploration.
test_sparsity.zip
The text was updated successfully, but these errors were encountered: