hmtx - Horizontal Metrics Table (OpenType 1.4)
The type longHorMetric is defined as an array where each element has two parts: the advance width, which is of type USHORT, and the left side bearing, which is of type SHORT. These fields are in font design units.
typedef struct _longHorMetric { USHORT advanceWidth; SHORT lsb; } longHorMetric;
Field | Type | Description |
---|---|---|
hMetrics | longHorMetric[numberOfHMetrics] | Paired advance width and left side bearing values for each glyph. The value numOfHMetrics comes from the 'hhea' table. If the font is monospaced, only one entry need be in the array, but that entry is required. The last entry applies to all subsequent glyphs. |
leftSideBearing | SHORT[ ] | 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 numGlyphs (from 'maxp' table) minus numberOfHMetrics. 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. This allows a monospaced font to vary the left side bearing values for each glyph. |
For any glyph, xmax and xmin are given in 'glyf' table, lsb and aw are given in 'hmtx' table. rsb is calculated as follows:
rsb = aw - (lsb + xmax - xmin)
If pp1 and pp2 are phantom points used to control lsb and rsb, their initial position in x is calculated as follows:
pp1 = xmin - lsb pp2 = pp1 + aw
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
OpenType specification