Left side bearing (source code)

= Left side bearing
{title2=$\mathrm{lsb}$}

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 $x=0$ and call the left ink edge $x_L$. Then $\mathrm{lsb}=x_L$. A positive value leaves space before the ink; a negative value means that the ink overhangs the origin.<Glyph Metrics in the FreeType documentation>[Section 3: bearings and advances]{ref}

For example, a <glyph> whose ink occupies $40\le x\le540$ 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.

\Image[/glyph-side-bearing-geometry.png]
{title=Horizontal <glyph> metrics: <left side bearing>, ink width and <right side bearing>}
{description=Original schematic of a hypothetical <glyph> with advance 600 <font units>. The rectangle is its ink <bounding box>, not a reconstructed outline from a particular <computer font>.}

<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.<Horizontal Metrics Table by Microsoft>[Opening discussion of hmtx, glyf, head flags and the derivation of side bearings]{ref}