D.5. The Tables That Pertain to TrueType-Style Glyph Descriptions

We have already mentioned that an OpenType font can be of either of two types: it can contain glyph descriptions written in TrueType, or it can contain PostScript CFF code with Type 2 charstrings. In this section, we shall concern ourselves with the tables that pertain to the first case. TrueType and AAT fonts must necessarily be of this type.

D.5.1. The loca Table

In a binary TTF file, loca is a table of pointers to glyph descriptions in the glyf table (pointers calculated with reference to the start of the glyf table). This table does not belong in a TTX document (this is precisely the sort of calculations that we avoid by converting to XML). We find merely

    <loca>
      <!-- The 'loca' table will be calculated by the compiler -->
    </loca>

Isn't that beautiful?

D.5.2. The glyf Table

This table is often the bulkiest one in a TrueType font. It is certainly the most important one, as it contains the descriptions of the contours of the glyphs, and a font without glyphs is like a forest without trees. Here is an example of the glyf table: the letter 'A' from the font Palatino Linotype:

 <glyf> ... <TTGlyph name="A" xMin="35" yMin="-" xMax="1545" yMax="1487"> <contour> <pt x="44" y="-" on="1"/> <pt x="35" y="0" on="1"/> <pt x="35" y="52" on="1"/> ... 43 similar lines ... <pt x="363" y="0" on="0"/> <pt x="266" y="0" on="1"/> <pt x="156" y="0" on="0"/> </contour> <contour> <pt x="500" y="553" on="1"/> <pt x="1006" y="553" ...

Get Fonts & Encodings now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.