'hmtx' table contains metric information for the horizontal layout each of the glyphs in the font. It begins with the hMetrics array. Each element in this array has two parts: the advance width and left side bearing. The value numOfLongHorMetrics is taken from the
'hhea' (Horizontal Header) table. In a monospaced font, only one entry is required but that entry may not be omitted.
Optionally, an array of left side bearings follows. Generally, this array of left side bearings is used for a run of monospaced glyphs. For example, it might be used for a Kanji font or for Courier. Only one such run is allowed per font. It must be at the end of the table.The corresponding glyphs are assumed to have the same advance width as that found in the last entry in the hMetrics array. Since there must be a left side bearing and an advance width associated with each glyph in the font, the number of entries in this array is derived from the total number of glyphs in the font minus the value numOfLongHorMetrics.
A longHorMetric is defined by the C structure shown here:
Table 24 :
|longHorMetric||hMetrics[numOfLongHorMetrics]||The value numOfLongHorMetrics comes from the
|FWord||leftSideBearing||Here the advanceWidth is assumed to be the same as the advanceWidth for the last entry above. The number of entries in this array is derived from the total number of glyphs minus numOfLongHorMetrics. This generally is used with a run of monospaced glyphs (e.g. Kanji fonts or Courier fonts). Only one run is allowed and it must be at the end.|
Although it is officially listed as a "required" TrueType table, the
'hmtx' table is not in fact required for all sfnt-housed fonts on the Mac OS.
Non-TrueType fonts housed in an sfnt data structure may not have a
'hmtx' table. This is allowed by the OFA2 architecture.
TrueType fonts which have no outline data but consist of bitmaps only should not have a
'head' table. They should use the byte-by-byte identical
'bhed' table instead. The Mac OS uses the presence of a
'bhed' to signal the fact that a font has no outlines. Such fonts may also lack an
Although they consist of bitmaps only, Newton fonts are required to have the
The value of the numOfLongHorMetrics field is found in the
'hhea' (Horizontal Header) table. Fonts that lack an
'hhea' table must not have an
Other tables may have information duplicating data contained in the
'hmtx' table. For example, glyph metrics can also be found in the
'hdmx' (Horizontal Device Metrics) table and
'bloc' (Bitmap Location) table. There is naturally no requirement that the ideal metrics of the 'hmtx' table be perfectly consistent with the device metrics found in other tables, but care should be taken that they are not wildly inconsistent.
Editing of the
'hmtx' table is possible using TrueEdit. Other tools may automatically update fields in the
'hmtx' table as needed.
[Table of Contents]