Include Anchor in Recipe

Is there a way to specify what anchor to use for “Add Glyph”?

I am writing a script that is project specific and I’m aiming to use a base glyph and a component to create multiple glyphs by having the component attach to different anchors. I want to try to avoid writing glyph data for this and just use the macro window, or a script from the pulldown menu.

How should anchor be used in the “Add Glyphs” dialog?
This could be what you are looking for: Roll your own glyph data | Glyphs

I think that solution would work. However, when I try to save the GlyphData.xml file, nothing saves and no error message appears.

What app did you use to GlyphData.xml. You should use a text editor like TextMate, Sublime Text or VS Code.

I was originally trying to use the EditGlyphData app which wasn’t allowing me to save a file. Using a text editor is working fine, though.

Thanks!

I am trying to get one glyph to work and have written a quick code, but it’s not working. I can’t find the ‘o.flourishmiddlerightup’ and ‘flourish.middlerightup’. The additional anchor that I put in the ‘o’ is, however, working. The syntax looks correct, but maybe I am missing something:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE glyphData [
<!ELEMENT glyphData (glyph)+>
<!ATTLIST glyphData
	format			CDATA		#IMPLIED>
<!ELEMENT glyph EMPTY>
<!ATTLIST glyph
	unicode			CDATA		#IMPLIED
	unicodeLegacy	CDATA		#IMPLIED
	name			CDATA		#REQUIRED
	sortName		CDATA		#IMPLIED
	sortNameKeep	CDATA		#IMPLIED
	category		CDATA		#REQUIRED
	subCategory		CDATA		#IMPLIED
	case			CDATA		#IMPLIED
	direction		CDATA		#IMPLIED
	script			CDATA		#IMPLIED
	description		CDATA		#IMPLIED
	production		CDATA		#IMPLIED
	altNames		CDATA		#IMPLIED
	decompose		CDATA		#IMPLIED
	anchors			CDATA		#IMPLIED
	marks			CDATA		#IMPLIED>
]>
<glyphData format="2">
	<glyph unicode="006F" name="o" category="Letter" case="lower" script="latin" description="LATIN SMALL LETTER O" anchors="top, bottom, center,right, topright, ogonek" marks="horncomb, caroncomb, gravecomb, acutecomb, circumflexcomb, tildecomb, dieresiscomb, hungarumlautcomb, macroncomb, brevecomb, slashlongcomb, dotbelowcomb, ogonekcomb, dblgravecomb, hookabovecomb, breveinvertedcomb, verticallinebelowcomb, circumflexcomb_acutecomb, circumflexcomb_gravecomb, circumflexcomb_hookabovecomb, circumflexcomb_tildecomb, flourish.middlerightup" />
	<glyph unicode="F0000" name="o.flourishmiddlerightup" decompose="o, flourish.middlerightup" category="Letter" case="lower" script="latin" description="LATIN LOWER CASE LETTER O WITH FLOURISH" />
	<glyph unicode="F0001" name="flourish.middlerightup" category="Mark" script="latin" description="FLOURISH MIDDLE RIGHT UP" />
</glyphData>

Did you anchors to the florist glyphs info and the actually glyphs?

Yes, the anchors are in both. The anchor cloud even shows the flourish on the lowercase o, but neither the ‘o.flourishmiddlerightup’ nor the ‘flourish.middlerightup’ show up in the glyph info.

The Glyph info window only shows global entry. Did you put the GlyphData in the Application Support/Glyphs 3 folder or next to the .glyphs file?

That would explain it!

Since that’s the case, is there a way to batch generate composite glyphs that are in a GlyphData.xml file?

I initially thought I could write a script to do that, but then thought that using a project specific GlyphsData.xml would work along with a list that includes the glyphs that need to be generated. That second option didn’t work, I’m guessing because that method would also be looking in the application’s GlyphData.xml.

No. The GlyphData contains 33.000 entries.
You can use a list filter or a custom category file for this.