Variable font: some glyphs exporting at double size, but only at a specific weight and width combination

I’m currently working on a variable font that contains 4 masters (thin condensed, thin extended, regular condensed, regular extended), with 6 exported instances (one for each master as well as regular and thin).

I’m getting a very strange behavior where when I export this font, 3 of the lowercase glyphs export at around twice the size they’re supposed to be, but only for one of the instances (in this case, the regular).

I recorded what it looks like when I export it as variable and scrub the width slider when it’s set to regular weight. You can find that video, as well as the .glyphs file and an exported .ttf containing the offending letters, as well as one additional completed glyph (E) that doesn’t seem to be affected by this problem.

I can’t think of any reason why this would be happening. The glyphs file displays no master compatibility issues whatsoever.

Any help is greatly appreciated.

Do those glyphs have intermediate layers?

Do you have a rectangular design space? That means: you need to have a master on every other axis for each location on one axis.

That is definitely what’s going on in the above file.

Sebastian, do you happen to know if there is already a script for filling in the missing coordinates? I have thought about making one a few times but never got around to it. On some level you could make the argument that Glyphs itself should do this on export, but I guess that would be confusing for e.g. fontmake and other tools that take Glyphs as an input source

I didn’t have a look at the file above, but if you want to fill up missing intermediate layers, I actually wrote a script a few weeks ago that does exactly this. It was written for a specific project with four masters, but I’m sure you can adapt it to work for any amount of masters:

# MenuTitle: Fill Up Intermediate Layers 
 # -*- coding: utf-8 -*- 
  
 __doc__ = """Adds missing intermediate layers for corresponding axis locations on all axes.""" 
  
 import itertools 
  
 axes_coords = [[] for axis in Font.axes] 
  
 for layer in Font.selectedLayers: 
     special_layers = [special_layer for special_layer in layer.parent.layers if special_layer.isSpecialLayer] 
  
     for i, axis in enumerate(Font.axes): 
         for special_layer in special_layers: 
             special_layer_coordinates = special_layer.attributes["coordinates"] 
             if list(special_layer_coordinates.values())[i] not in axes_coords[i]: 
                 axes_coords[i].append(list(special_layer_coordinates.values())[i]) 
  
     existing_special_layers = [tuple(special_layer.attributes["coordinates"].values()) for special_layer in special_layers] 
  
     necessary_coords = list(itertools.product(*axes_coords)) 
  
     missing_coords = [coord for coord in necessary_coords if coord not in existing_special_layers] 
  
     for coord in missing_coords: 
         coord_layer = GSLayer() 
         coord_layer.attributes["coordinates"] = {Font.axes[0].axisId: coord[0], Font.axes[1].axisId: coord[1]} 
         if coord[1]: 
             coord_layer.associatedMasterId = Font.masters[2].id 
         else: 
             coord_layer.associatedMasterId = Font.masters[0].id 
         coord_layer.color = 6 
         layer.parent.layers.append(coord_layer) 
         coord_layer.reinterpolate()
1 Like