User Guide
FontLab 4
700
First, open the font that you want to check and open and clear the Edit
Macro panel.
Type in the following simple program:
for g in fl.font.glyphs:
if len(g) == 0 and len(g.components) == 0:
print g.name
Run the program and check the results in the output panel.
Lets talk a little about the code above:
for g in fl.font.glyphs:
This line starts a loop that assigns the variable “g” to each of the glyphs
contained in the current font (which is referenced as “fl.font”).
if len(g) == 0 and len(g.components) == 0:
This line compares the length of the glyph outline and the length of the
“components” array (which contains all components) with zero and if there
are neither outline nor components it executes the next line.
print g.name
If the condition given in the second line is true, this line prints the glyph
name.
As you can see, with only 3 lines of code we have solved a problem that
typically takes about 30 minutes to perform.