Insert glyphs just for export

I want to insert a few glyphs into all instances of a font just before it’s exported into TTFs or OTFs. I do not want these glyphs to linger in the .glyphs file. Is this possible? If yes, are there any templates/samples I can use as a starting point?

Can you give an example what you are trying to do?

I’m trying an experiment to (re)construct a couple of dozen of my very old (ancient) Tamil fonts. It is like using components and auto-alignments but without using the feature in the UI. I’ll use a small set of ‘component glyphs’ to programmatically assemble the glyphs I need and put them into the font for GlyphsApp to export. Perhaps delete the inserted glyphs after the export because I don’t want them to linger in the source file. The ‘component glyphs’ are the only glyphs I want to manage in the .glyphs file. Does this make sense?

I wonder how that will interact with feature code (I suppose you like to use them somehow in substitutions).

1 Like

Yes, I was thinking about that too. It’ll be just one GSUB lookup in post. No GPOS. If it’s possible to insert this as well, that’ll be brilliant. Otherwise, there are two options: (i) Add OpenType outside of glyphs, which is not my preference. (ii) Insert empty glyphs so feature code will not complain, and fill up the glyphs at the time of export. I’m just trying to prevent managing these glyphs in the .glyphs file. There will be around 70 of them.

It might be less trouble to just add them. Mark them with a color and/or use a custom category/subcategory. If they use auto alignment you never need to touch them.

It might be possible to add a Add Glyphs parameter that uses recipes.

And there is a Add Feature parameter already.

1 Like

Thanks @GeorgSeifert I’ll give it a try!

Here’s a real case. I inserted two components to get one precomposed glyph.

The vertical stem should automatically align to the right. The rsb of the base is -10 and the lsb of the stem is 0. Auto-alignment is disabled in the font but enabled in the individual components in this glyph.

I inserted this by hand to see how it works before doing it via a script. What should I do to align the vertical stem to the right?

You need to activate alignment on font level and if needed, deactivate alignment for all components that would move otherwise (there is a script from Rainer to do this).

1 Like

I’ve only tried this by manually placing the components with global auto-alignment. It serves my purpose quite well - except for kerning. It looks like I have to kern the precomposed glyphs as well - or at least add them to kerning groups. In the attached image, the third glyph is a precomposed glyph (base+matra) that I do not want to touch. If I kern the base glyph (first and second glyph), the kerning is not reflected in the precomposed one. Is the any magic to make this work without doing anything to the third glyph?