Python in FontLab Studio
FontLab Studio 5.1.2 for Mac OS X
FontLab Studio 5.1.2 for Mac OS X works with Python 2.7 that comes pre-installed with Mac OS X. On Mac OS X 10.7 and newer, it uses Python 2.7 (in 32-bit mode). On older OS X versions, it uses the newest built-in Python. You don't need to install Python separately.
Note: the PowerPC version of FontLab Studio 5.0.4 for Mac OS X 10.6 and older works only with Python 2.3.
FontLab Studio 5.2.1 for Windows
FontLab Studio 5.2.1 for Windows works with the 32-bit version of Python 2.7. Even in you use a 64-bit version of Windows, you need to download and install the 32-bit version of Python 2.7.6 for Windows.
- Download the latest 32-but version of Python 2.7.6 for Windows.
- Run the setup.
- We also recommend that you download and install the Python for Windows extensions. Remember to pick the version that matches your Python version.
- Visit python.org to download additional modules and documentation.
Note: the old FontLab Studio 5.0.4 for Windows works only with Python 2.4.
How FontLab applications use the Python macro language - and some useful scripts
The Python macro language is a really powerful tool that can save you loads of time in performing tedious tasks. Need to add a bevel to all the characters in your font? A Python macro can do it in a flash. Want to rename all your fonts to add your foundry intials? Do the whole library in seconds with a macro. Got an idea for a new FontLab tool? Write it in Python and add it to the FontLab menus.
The Unofficial FontLab/Python API Reference documents the FontLab/Python scripting API
FontLab Scripting described at Wikibooks
FontLab Macro Setup at Wikibooks
RoboFab extensive documentation
Useful Python-based Software
- RoboFab by Tal Leming, Erik van Blokland and Just van Rossum
Python library that provides an independent font development environment that integrates with FontLab Studio and can be used for font, glyph and metrics manipulation. Free for Mac OS X and Windows. RoboFab requires NumPy (Mac installer on PythonMac) and FontTools TTX.
- FontTools TTX by Just van Rossum
Low-level OpenType table editing package written purely in Python. Free for Mac OS X and Windows.
- Adobe FDK for OpenType (AFDKO) by Adobe Systems
Set of high-quality OpenType conversion, editing, production and quality assurance tools, partly written in Python and integrated with FontLab Studio. Free for Mac OS X and Windows.
- FontQA by FontShop International
Font quality assurance framework and test suite for FontLab Studio written in Python and published by FontShop International, allows performing consistency checks across fonts within a font family. Free for Mac OS X and Windows.
- Autopsy by Yanone
A FontLab Studio add-on written in Python for analyzing design consistency across multiple fonts. It visualizes a selection of letters side by side and puts it into a PDF for visual comparison. If visual comparison isn't enough for you, it dissects what's there and what's not and puts that into simple graphs. Free, for Mac OS X and Windows. Requires ReportLab.
- FeatureProof by Tal Leming
FeatureProof is an application for testing built on top of Compositor that makes it easy for type designers to test OpenType Layout features in fonts. Free for Mac OS X.
- Font Remix Tools by Just Another Foundry
A set of plug-ins for FontLab Studio written in Python that allow scaling of glyphs without affecting the stroke weight.Free for non-commercial use, licenses 99-396 EUR, for Mac OS X and Windows. a set of plug-ins for FontLab Studio, that allow scaling of glyphs without affecting the stroke weight. They allow to:
- tune the width, height and weight of
single letters interactively
- automatically generate small caps
- generate superiors, inferiors, numerators and denominators
- create true condensed and extended versions
- generate tabular figures with only a couple of clicks
- slant glyphs while keeping vertical tangents straight
- Superpolator by Erik van Blokland
Professional typedesign is complex enough as it is: Superpolator breaks free from the conceptual constraints of Multiple Master: work with any number of axes, insert masters where you need them and define, generate all the weights you want. Glyph specific axes, split locations, intermediates, powerful extrapolation. Licenses 250 EUR and up, for Mac OS X. Requires RoboFab.
- PixelBrush by Gustavo Ferreira
A simple tool to draw outline pixel fonts in FontLab Studio. Free for Mac OS X and Windows.
- Compositor by Tal Leming
An OpenType Layout engine. Free for Mac OS X and Windows.
- feaTools by Tal Leming
A collection of tools for working with OpenType Layout feature definition source files in AFDKO .fea format. Free for Mac OS X and Windows.
- Scripts and tools by Tal Leming
A collection of useful FontLab Studio scripts and Python tools. Free for Mac OS X and Windows.
- dialogKit A humane way to build interfaces in FontLab.
- fontAppTools A small collection of tools useful in font editing applications.
- fontMath A collection of objects that implement fast font and glyph math.
- defcon A set of UFO based objects for use in font editing applications.
- defconAppKit A collection of Vanilla objects for use in font editing applications.
- Scripts by Typo.cz
Two sets of macros for FontLab Studio by Typo.cz (Filip Blazek), written in Python. Both sets contain some handy scripts for relabelling of glyphs and for control of the process. The macros will be available near the end of 2008.
- OpenType features set automates generating of special OpenType functions.
- OpenType kerning simplifies the setting of kerning pairs for accented characters.
- Scripts by Ben Kiel. Free for Mac OS X and Windows, optional donation.
- placeAnchor will place anchors on selected glyphs with a name and height of your choosing.
- removeAnchors and removeSelectedAnchors remove either all the anchors from a font or the anchors on selected glyphs in a font.
- buildAccents will build accented characters from glyphs which have anchors.
- betterGenerateFont will make a copy of the font you are working on, remove its overlaps and decompose its characters, then give you the choice of font type to generate.
- Guidelines show how one can add and remove guidelines to a vfb file.
- copySidebearings will copy the sidebearing values from one vfb to another. copySidebearingsToMaster will copy the sidebearings from a font to a specified master in a MM vfb.
- multipleMasterTools will quickly generate any number of instances of a MM face, either as font files or vfb files (or both).
- SVH Helper Script for RoboFab by Brook Elgie
Python script that integrates SVN version control with RoboFab. Free for Mac OS X and Windows.
- RemoteTCP for RoboFab and FontLab by William Lamberta
RemoteTCP is a cross-platform implementation of the RoboFab Remote package that allows FontLab to respond to calls from other applications over a network connection.
- Python Imaging Library by Pythonware
Essential image processing package for Python. Free for Mac OS X and Windows. Mac installer on PythonMac. Windows installer on Pythonware.
- FontLab on Steroids macros by Adam Twardoch
Script for FontLab Studio written in Python, includes Rename glyphs by scheme macro. Free for Mac OS X and Windows.
- Outline Font by Roger Dawkins
Macro to create an outline version of a font: development, script.
- Special Effects by Vince Fitter
Some nice little macros for special effects: Windows version, Macintosh version
- Scripts by Christian Robertson
- Corner Mitring - subtly mitres any extra sharp corners that are created when removing overlaps.
- "Build" scripts - used to assemble font from components.
- Interpolated Nudge - simply moves control points proportionally with the anchor points.
- Auto Add Anchors - adds anchors to the tops/bottoms of common letters.
Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java. Originally developed by Guido van Rossum in 1990 it is an open source language and has gained popularity rapidly. For this reason we chose it as the scripting language for FontLab 4 macros.
www.python.org is the official Python website
Python Books and Resources:
Macro Programming, FontLab Studio manual
Python Programming for the Absolute Beginner
FontLab Scripting discussion list
The Python Bookstore