User Guide
Macro Programming
699
First Steps
Lets write a few basic programs. The “Hello World!” program is a typical
benchmark of the simplest useful program you can write. It is very easy to
do in FontLab/Python:
1. Open the Edit Macro panel.
2. If there is something there, click on the button and select the
New program command to clean the editing field.
3. Enter the following code:
print “Hello World!”
4. Click on the button to run the program.
5. You will see the output panel appear on the screen containing our text:
All text you output with the Python print operation appears in the Output
panel. There is more information about using this panel in the OpenType
chapter on page 657.
OK, now let’s do something more useful using FontLab classes (which are
partially described below). Suppose we want to find all the glyphs that are
empty: i.e. don’t have an outline or any components. The “space” is a good
example of such a glyph.