Labeling Glyphs

Wouldn't it be nice to be able to put labels on the glyphs? Let's extend the syntax of a Glyph line. We need a keyword "labeled" and a text string for the label. Labels can be positioned to the left of, to the right of, above, or below the glyph. So another keyword specifying the position is needed.

Here is an example of a new configuration file.


Take a peek at the source code. Notice that labels are glyphs in their own right. The thing that is different about label glyphs is that they can be assigned another glyph to label.

Exercises

  1. A Glyph can be assigned to more than one label. Extend the Glyph line's "labeled" phrase to allow multiple labels.
  2. A label can be positioned in the center of its labeled glyph. Add this option. Watch out for writing blue text on a blue glyph.

Next: Manufacturing Glyphs