Allow "Import Font" for differing master numbers

Hello, it would be very useful to allow using the “Import Master” parameter even if the number of masters differs.

Example: I have a base file with roman and italic masters. I now have a “Stencil” file with some modified glyphs, but I use “Import Font” to import all glyphs that are identical. However, the Stencil font only has roman masters, not italics.

Glyphs refuses to import the font, because the number of masters differs. The axis locations of the masters are identical, though, so I think the masters that have a matching master in the corresponding file should be imported.

I see that Import Master already fails even if the master names are different. This really appears overly restrictive.

Suggestion: Match all masters by axis location. If no match is found, just don’t import that master.

Could you send me sample files?

Here is a sample. Two files, the one from which I want to import the font has more masters, but one master with exactly the same name and axis locations.

ImportFonts.zip (5.2 KB)

Fixed it.

Thank you very much!

One more request: Is is thinkable that if a project has only one axis, but another one has two, the missing axis is just interpreted as “0”?

So, for example, I have a font with a weight and an italic axis, and I want to import its roman masters into another file, which only has a weight axis. The missing italic axis should be interpreted as “0” in order for a match to be found. Does this make sense, or is it too hacky?

0 is probably not a good default for all axes (width → 100, weight → 400, …), so this would also need to be customizable per axis.

Makes sense. Then take the first master that matches for the present axes?

In case control is needed, users can just add the axis to the target font.

I changed it that it maps master names. A difference in axis shouldn’t matter. But I didn’t try it.

Thanks, I’ll try that out!