Resources for learning scripting?

eliason's picture

What are useful available resources for learning how to script within the type-design process? I'm well aware that I'm missing out on automation opportunities as I go through a font glyph by glyph expanding each stem by three units in each direction. :-( I'm comfortable in the abstract with the idea of programming, but I have never done any work in Python.
Is there a beginners' guide somewhere? Or simple example scripts?

eliason's picture

I guess what I really need is confirmation that poring over the Robofab stuff (robofab.org) is where I should be looking, even if I'm working with .vfb's in FontLab rather than .ufo's in Robofont.

Mark Simonson's picture

This is a good place to start:

http://robofab.org/talks09/index.html

Most of not all of the examples can be run in the macro window in FontLab. You just type or paste-in the script, and hit the ">" button. The results appear in a separate output window.

FWIW, there are better apps for trying out Python stuff. I like TextMate. Terminal works, too. Just type "python" at the prompt, and away you go. OTOH, it makes more sense to be in FontLab, Glyphs, or RoboFont to do stuff with fonts (at least when starting out).

hrant's picture

{To Follow}

George Thomas's picture

A self-paced online full certificate course from the University of Chicago at Urbana:
http://www.oreillyschool.com/certificates/python-programming.php?gclid=C...

Mark Simonson's picture

Python's capabilities go far beyond what you need to make use of it in font production. Several books I've bought on the subject seem to assume I'm going to use it to program web apps or scientific apps or shell scripts or something. They oftentimes spend a big portion of the book going over platform-specific IDE issues and working with different add-on packages and tools. This is overkill for font development use. Most font editors let you run Python in them directly, so you probably don't need to set anything up (except for maybe Robofab and FontTools) in order to start working with it.

I would recommend either of these books:

Learning Python (O'Reilly), by Mark Lutz & David Ascher
Python for Software Design: How to Think Like a Computer Scientist, by Allen B. Downey

The second one doesn't assume you know any other programming languages.

There is also a decent tutorial at python.org: http://docs.python.org/tutorial/

There is also DrawBot, which is used to teach Python at the TypeMedia department of the Royal Academy in The Hague: http://drawbot.com/index.html

daverowland's picture

Craig, if you learn to script, can I put a request in for this as a fontlab plugin (for windows - sorry, I was brought up with PCs and find Macs very difficult to use). Or anyone else for that matter. Don't know how lucrative scripting for font designers is but I for one would license it.

malcolm's picture

If this is your first foray into Python on FontLab, don't try to install and learn RoboFab immediately. If you don't have experience, installing it (particularly on a WinBox) can be problematic and will just deter you from proceeding further. Just try a few lines directly in the FontLab Macro Panel and start to understand the syntax and FontLab classes.
Start with something simple like
f = fl.font
for g in f.glyphs:
print g.unicode
and experiment with things on http://www.e-font.de/flpydoc/
Learning Python (O'Reilly), by Mark Lutz & David Ascher is an excellent resource for learning the basics of Python.
Once you discover the limitations of FontLabs own classes, you may then want to dive into RoboFab if you feel the need.

Syndicate content Syndicate content