Typefaces and Coding

Hi everyone!

I’m currently working on my first two typefaces and have a question about type design workflow. I see many type designers using VS Code to handle kerning and make adjustments in Python. I’ve read that this approach can simplify many steps through small bits of code. Could anyone guide me on how to set this up? Is there a tutorial or resource on how to integrate Python with font editing software like Glyphs? I’m having trouble finding detailed information online.

Any advice or resources would be greatly appreciated! Thanks in advance!

Python is already fully integrated with Glyphs – once you install Python in PreferencesAddons, you can run Python scripts via the Script menu, and there’s a macro panel that allows you to execute arbitrary Python snippets directly.

There’s lots more in the scripting tutorial that begins here:

1 Like

To get started with Python scripting in Glyphs, have a look at this tutorial series:

But perhaps someone else has already written a script that does what you want. You can search for existing scripts here:

There are also plugins that help with automatic kerning. You can find them in the Plugin Manager in Glyphs. A notable plugin that can be acquired outside the Plugin Manager is Kern On:

1 Like

Thank you for the help!

Thank you, would you recommend using the scripts for kerning or doing it by hand?

That depends on your project and experience. I would start manually and see how much kerning is needed. If your spacing is well done, you might not need much kerning. Only use automation once you notice/suspect the kerning work getting too much for manual work.

1 Like

Ok.

When i type “print (hello)” in the macro, I get a Traceback and NameError?

Have a look at the Addons settings:

What “Python version” do you see?

1 Like

3.11.9 (Glyphs)

Can you paste this code into the Macro Panel and hit run?

print("Hello")

Then, post a screenshot of the Macro Panel here.

1 Like

print(hello) is not valid Python – you need quotes around the string, otherwise it’s interpreted as a variable name, and there’s no variable named hello.

2 Likes

Stupid, forgot “”.

Thank you!

1 Like

Especially if you’re starting out, do the kerning by hand. You will learn a lot, especially in conjunction with spacing. A good rule of thumb is: if you can do it well manually, you can speed up the process by using tools to automate it. This applies to a lot of aspects of drawing, spacing and kerning.

1 Like

Thank you for the answer, I will do the kerning by hand at first and try to do it with Python after. Just to get to used to Python.

I’m not really sure what you mean by doing the kerning in python. How do you expect that to work?

No me neither. But I saw on ArrowType’s YouTube channel that he does kerning or kerning related stuff in VS Code, and he said something about Python. So I was curious, maybe you can explain to me what he does ?

This is the link: https://m.youtube.com/watch?v=3a9KIPi_rTU

He’s working with MetricsMachine, which is a (really pricey) RoboFont extension, not Glyphs.

1 Like

It might be worth clarifying that coding is not like typing a few commands that do your kerning quicker. It’s rather the opposite — instead of clicking the buttons that Glyphs already have for you, you reinvent the wheel your way from scratch. It is indeed very helpful, but after you reach the limits of the app, and know what you’re missing and how to do it better.

1 Like