Help with components and synchronised weights

Hello, I’m pretty new to glyphs and would need some help with masters and components. I’m designing a musical font and would like to have a second version of it (as a weight) with 5 lines behind each letter. These lines should adapt to the width of each letter.
Also, how could I make it as when I modify a letter in the first weight it changes in the second? Should every letter also be a component? Thanks

Can you post some sketches of what you are trying to do?

These should be the 2 weights:

I recently wrote some scripts for a similar project.

  • Install a filter called ‘LayerGeek’ from Window > Plugin Manager > Plugins. Restart Glyphs.app afterwards.
  • You create a glyph (Glyph > Add Glyphs…) called _lines and make it exactly 100u wide. Add those 5 lines stretching from the LSB to the RSB in that glyph.
  • Create a second instance in Font Info > Exports.
  • Copy the following snippet, select the instance in Font Info > Exports, click belpw the words Custom Parameters to set the focus, and paste.
{
customParameters = (
{
name = Filter;
value = "LayerGeek; decomposeComponents; components.append(GSComponent('_lines')); components[0].setScale_(NSPoint(Layer.width/100, 1.0)); decomposeComponents; cleanUpPaths; except: _lines";
}
);
}

It should look something like this:

Then you return to the Edit view and you should be able to get a preview if you pick the new style in the preview area at the bottom. And when you export it, it will automatically co-export the lined version. If you want to exclude more glyphs, add their names to the end, where it says export: _lines (add a comma and write the glyph name you want excluded).

1 Like

Everything seems to be working except for the glyphs app crashing when I try to export the font. Would you have any ideas to what may be causing it?

Can you please send me the .glyphs file to support (at) (this website without ‘www’ or ‘forum’). I will have a look.

1 Like

I sent you the file, thanks a lot!

I had a look at the file. The layerGeek command needed some adjustment.
LayerGeek; decomposeComponents; shapes.append(GSComponent('_lines')); components[0].setScale_(NSPoint(Layer.width/100, 1.0)); setNeedUpdateShapes; decomposeComponents; cleanUpPaths; except: _lines
and it needs an extra
Filter: RemoveOverlap;.

It works perfectly now, thank you very much for your help :slight_smile: