A glyph bearing is a signed offset locating a glyph's ink relative to the reference used for layout. In a simple horizontal metric, the left side bearing measures the offset from the pen position to the left ink edge, and the right side bearing measures the remaining distance from the right ink edge to the advance endpoint.[ref]
Glyph Metrics in the FreeType documentation. §3: bearings and advances
Put the origin at , the glyph advance at , and the ink edges at . ThenFor , and , the bearings are and 3, while the ink width is 11. The negative left bearing records an overhang across the origin. The next nominal pen position remains at .
Ink bounds, side bearings and glyph advance
. Original horizontal schematic with an invented outline: left ink edge -2, right ink edge 9, advance 12. The plotted shape is not copied from a font. Horizontal measurements are in consistent arbitrary units. Details.These are measurements of a default horizontal arrangement. Subsequent glyph positioning and kerning can change the rendered relationship between neighbouring glyphs. The reference point and axes must also be checked when applying bearing conventions to vertical layout.
In a simple unpositioned horizontal layout, the left side bearing is the signed distance from a glyph's pen position to the left edge of its ink bounding box. Put the logical origin at and call the left ink edge . Then . A positive value leaves space before the ink; a negative value means that the ink overhangs the origin.[ref]
Glyph Metrics in the FreeType documentation. Section 3: bearings and advances
For example, a glyph whose ink occupies and whose glyph advance is 600 font units has left side bearing 40, ink width 500 and right side bearing 60. These are default metrics; subsequent glyph positioning can change the rendered arrangement.
OpenType's horizontal-metrics table supplies the left side bearing and glyph advance. One must not assume that every outline's stored
xMin is already the left side bearing: the outline's own coordinate origin and the metrics' logical origin need not coincide in every supported format.[ref]Horizontal Metrics Table by Microsoft. Opening discussion of hmtx, glyf, head flags and the derivation of side bearings
The right side bearing measures the signed gap from the right edge of a glyph's ink bounding box to the point specified by its default horizontal glyph advance. If the origin is , the advance is , and the ink edges are , thenThus the advance splits into a left side bearing, an ink width and a right side bearing. OpenType uses this relation to derive the right side bearing from the horizontal metrics and outline bounds.[ref]
Horizontal Metrics Table by Microsoft. Deriving rsb from aw, lsb, xMin and xMax
For the hypothetical ink interval and advance 600 font units, the right side bearing is 60 font units. If a different glyph extends to with the same advance 600, its right side bearing is font units: ink crosses the next nominal origin. A negative bearing is therefore meaningful rather than an invalid width.
These are metrics of an individual default glyph. Kerning and other glyph positioning rules can change the actual gap between adjacent shapes, so the right side bearing alone does not determine the visual spacing of a whole run.
Articles by others on the same topic
There are currently no matching articles.

