Kerning (source code)

= Kerning
{wiki}

<Kerning> adjusts spacing for particular combinations of <glyphs>. For example, the open region beneath an overhanging “T” can allow a following round <glyph> to be placed closer than a uniform spacing rule would suggest. The <OpenType> `kern` feature provides context-dependent adjustments for horizontal layout; the separate `vkrn` feature addresses vertical layout.<Kerning in the OpenType Registered Features by Microsoft>[Feature kern: function, To example and relation to vkrn]{ref}

In a simplified horizontal pair model with default <glyph advances> $a_1,a_2$ and adjustment $k$, the total advance is $a_1+a_2+k$. A negative $k$ reduces the gap for that pair, while a positive $k$ increases it. The numerical value depends on the <computer font>, its scale and the applicable layout rules; a particular letter pair does not have one universal adjustment.

<Kerning> is one application of <glyph positioning>. It can preserve the same <glyph indices> while changing their arrangement. A <typographic ligature> instead selects a combined form through <glyph substitution>. Selecting an appropriate form and placing it well are complementary parts of <text shaping>.