-
Notifications
You must be signed in to change notification settings - Fork 51
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
Designspace axis definitions have reversed userspace (input) and designspace (output) coordinates #745
Comments
I've attached a v2 Glyphs file that can reproduce the problem. Note that this fails entirely if saved as v3 (see #746) |
@jpt thanks for filing this issue! I just stumbled on this while tinkering with Glyphs.app, and I wonder how could this have gone unnoticed for so long. Apologies for that. Ever since we added support for this "Axis Mappings" custom parameter, we have been interpreting it as a mapping from user-space to internal design-space coordinates, see: glyphsLib/Lib/glyphsLib/builder/axes.py Lines 183 to 186 in 74aefb3
The key part is However... Glyphs.app interprets it the other way around, as a map from {internal: external} coordinates. I think this is a complete disaster. I am pretty certain that there are a lot of .glyphs-based font projects that were meant to be built using fontmake that define Axis Mappings as {external: internal}, as there are similarly lots of others that do the opposite but meant to be exported directly from Glyphs.app... There's no way to be certain what the intention of the font developer actually was, and it is too late to change either Glyphs.app or glyphsLib at this point.. One limitation of Axis Location vs Axis Mappings is that the latter could in theory define additional mappings that don't directly correspond to an existing master or instance (just like an avar can do), wheres Axis Location is tied to the existing masters and instances. |
/cc @schriftgestalt |
I think we should fix glyphsLib and let font developers deal with the fallout (I’m certain I have a few fonts that fell victim to this). A bug is a bug and the fact that some projects worked around it does not change much. |
IIRC, glyphsLib implemented support for the "Axis Mappings" custom parameter even before Georg did in Glyphs.app, with #618 |
digging into this a bit more, before @m4rc1e worked on implementing support for Axis Mappings in glyphsLib we had discussions with @schriftgestalt about how to best define the new custom parameter (Marc even wrote a doc about this). but it seemed we had finally settled on {external: internal} .. until now I realised Glyphs.app actually implemented it the other way around. |
I still think it is a bug if it doesn't match user expectation i.e. what Glyphs UI shows. I was certainly confused by this more than once and re-edited the source to match what glyphsLib is doing, and it is going to confuse more people in the future. |
…way around... Fixes #745 (by breaking everyone's font)
To my understanding we have a bunch of existing, working, builds that presumably rely on this being "backwards." Having them all build wrong on the next fontmake update strikes me as breaking user programs in the sense described in https://lkml.org/lkml/2012/12/23/75. How might we avoid nuking users from orbit and in time reach a place where our compiler and Glyphs agree on this mapping? Perhaps a good start would be to track down some basic data:
|
meant to investigate googlefonts/glyphsLib#745
meant to investigate googlefonts/glyphsLib#745
@anthrotype's data in rsheeter/google_fonts_sources#3 makes it look pretty plausible to make fontmake figure out which direction the mapping goes. That might allow us to support Glyphs intended mapping direction without breaking existing sources because we'd detect the reversal, warn, and then compile the font correctly. |
If I need to update some data structures when opening files, I check the build number from OR I could change it in Glyphs (the upcoming 3.2 update could allow for a change like that). We are discouraging the usage of "Axis Mapping" for some time now (in favor of the "Axis Location" parameters. So the fallout should be rather small. |
actually that would be most welcome, if you could implement that in a backward compatible way by looking at the .appVersion 👍 |
done in version 3.2 3168 |
Thank you Georg! |
Random thought: should we drop Axis Mappings and always just write Axis Locations? |
This is fixed on GlyphsApp side, no need to change anything here. |
Given the following example
Axis Mappings
custom parameter:I get this output:
Expected output:
The dimension and xvalues elsewhere in the designspace file correctly point to the internal coordinates.
I wonder if this could be caused by the masters themselves also having remapped axis locations? For example on the master with
72
as the internal coordinate, theAxis Location
custom parameter is defined as such:The text was updated successfully, but these errors were encountered: