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:
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.
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
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"
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?