Automatic linking/copying glyphs in Master

Hi there, I’m currently working on the trial version and really loving the app.

I’m working on a pattern font and was wondering if there’s a way to automatic link glyphs between masters. Like in the screenshot below, all the “Thick”-masters are simply copies of the “Thin”-masters with the corresponding numbers. The only thing that changes between Thin and Thick is the stroke width of the glyph. Is there a way to automatically to link the base glyph, without copying all of them?

For example, linking Thin-0 with Thick-0 and Thin-90 with Thick-90.

Thanks!

Can you share a screenshot of the pattern and how it changes for the different masters? You probably don’t need to use this many masters.

Hi, thanks for the reply!

You can find the screenshots below. I’m working on grid-based pattern fonts. This font has 52 glyphs (basically strokes), at a different angle. The idea is to have the possibility in a variable font to adjust the width of the stroke (Thin-Thick) and the rotation angle (0 - 360°).

Without all the different rotation masters (0-360°), the interpolation between the rotation angles didn’t come out correctly, as it skewed the length of the strokes.

Thanks!

There is no way to “link” such masters. You can, however, use scripting to get the desired result.

For example, the following script copies the paths from the “Thin” layers to the “Thick” layers and changes the stroke with on the thick layers to a new value (in this example 100):

sourceName = "Thin"
targetName = "Thick"
targetStrokeWidth = 100
# copy paths from source  layers to target layers and change target stroke widths:
glyph = Layer.parent
for layer in glyph.layers:
	if layer.name.startswith(sourceName):
		otherLayerName = layer.name.replace(sourceName, targetName)
		otherLayer = glyph.layers[otherLayerName]
		if otherLayer is not None:
			otherLayer.shapes = layer.shapes
			for path in otherLayer.paths:
				if "strokeWidth" in path.attributes:
					path.attributes["strokeWidth"] = targetStrokeWidth
		else:
			print(f"no layer named '{otherLayerName}' could be found")

Select a glyph and run the script from the Macro Panel. You can edit the values of the first three lines to use different master names or a different stroke width.

My god! This will save me so much time…

Many, many thanks!