Exporting layers?

Thank you again for your quick answer!

I tried installing drawBot but it doesnt seem to work. It does not open drawBot, there is always this error message occurring:

I am sorry I could not reply anymore after 3 replies, so I added this into my old message.

Have you installed drawBot? Install it from the plugin manager. Then run the script in the script in the Drawbot window (you get a new on in the File menu).

And I just updated the drawbot plugin that you can run the script from the Macro Window. In this case, you need to add this line at the top of the script:

from drawBot import *

Also try the latest Glyphs 2. Version 2.6.8 it should be.

hey mekkablue,

Thank you very much for your reply!

I have installed glyphs 2 version 2.6.8. But now my glyphs app won’t open anymore every time I try to install drawBot.

I came across this forum post (Glyphs 2 compatibility with macOS 12.3) but I am not getting along and I don’t know what to do exactly.

is there any other way to export all the layers of a letter into a PDF without drawBot?

Or is there a solution to the problem for glyphs 2.6.8 on Mac Osx 12.5?

The error message above suggests that your installation is lacking the modules. You need to install them via Glyphs > Preferences > Addons > Modules > Install Modules.

Glyphs 2 only supports macOS up to 12.2. If the instructions in the article for making Glyphs 2 work in 12.3+ do not work for you, then I am afraid I cannot help you.

Dear Georg and mekkablue,

I wanted to say thank you so much for all the amazing and superfast support!
I finally managed to get it to work. :slight_smile:

1 Like

Hey there!
I hope you are doing good!
Unfortunately I have one more question regarding the script.
The name of the layer is always placed in a position related to the “glyph” and not the format itself.
For example, the layername of the glyph “W” is at a different x-position than the layername of the glyph “I”.
Is it possible to have the layername at a fixed position in the format, not in relation to the position of the glyph?

thank you very much for your help in advance!

from GlyphsApp import *
from datetime import date

Height = 1000
extraSpace = 2.6

layers = Glyphs.font.glyphs["W"].layers

#print len(glifo) , ("glyphs in this font")
print len(layers) , ("layers in this glyph")

master = Glyphs.font.masters[Glyphs.font.masterIndex]

Scale = Height / (Glyphs.font.upm * extraSpace)

offsetY = -master.descender + 500

for glyph in Glyphs.font.glyphs:
    layers = glyph.layers
    for i in range(len(layers)):
	    print(layers[i])
	    newPage(Height, Height)
	    save()
	    scale(Scale)
	    offsetX = ((Height / Scale) - layers[i].width) /2
	    translate(offsetX, offsetY)
	    drawPath(layers[i].completeBezierPath)
	    fontSize(20)
	    layerName = layers[i].name
	    if layerName == "Regular":
	        layerName = date.today()
	    if layerName != "Regular":
	        layerName = layers[i].name	        
	    text(layerName,(200,-800))
	    print(text)
	    text("Placeholder", (1200, -800))
	    restore()
	    saveImage("~/Downloads/Export_Dimitris/test.png", 120)
type or paste code here
1 Like

It depends on how you format your print string. And why do you need it in a fixed position? For copying into a spreadsheet? Consider tabs like this: "\t"

yes exactly, I need it to load it into indesign later, where I could use the layername at a specific position like a footnote.

Okey great i will try to add them with tabs first.

Hello :slight_smile:

I have installed the drawbot plugin, to use it I seem to be missing the FontTools module. However, when I try to install it, the message “Failed to get HEAD (unborn)” appears. See screenshots 1–3. How can I solve this?



Screenshot 2024-02-23 at 10.46.56

Hmm. Seems to be broken. Better use Window > Plugin Manager > Modules and install all the modules there.