Ascender (typography) 2026-11-05
An ascender is the part of a lowercase glyph that extends above the main lowercase body, whose reference height is the x-height. Familiar examples occur in “b”, “d” and “k”. It is a feature of a particular drawn form, rather than a promise that every glyph in the font reaches the same height.[ref]
In a hypothetical computer font, put the text baseline at , the x-height at 450 font units and the top of a chosen ascender at 730 font units. That part extends 280 font units above the lowercase reference. With 1000 font units per em and a scale of 20 pixels per em, the corresponding ideal heights above the text baseline are 9 and 14.6 pixels.
This local geometry is distinct from the global font ascent used by a text-layout system. That metric can also accommodate accents or other tall forms. Glyph positioning must preserve the chosen text baseline while allowing these different bounding boxes; simply aligning the tops of all glyphs would change the intended alignment.
Combining character 2026-11-05
A combining character is an encoded text character intended to combine with another character in its written presentation. A familiar case is U+0301 COMBINING ACUTE ACCENT: the sequence e followed by that code point represents an accented letter without requiring a separate precomposed code point for the whole letter.[ref]
The same acute-accent code point can mark a distinct letter, stress or tone in different languages. Those functions do not require a different encoding of the accent in every language. Text shaping determines how the selected glyph is attached to the base shape, and glyph positioning can place additional marks relative to earlier marks.
A combining sequence and a grapheme cluster are related but distinct notions. The default segmentation rules determine which code points an editor treats as one unit. Unicode normalization addresses equivalence between encodings, such as a precomposed accented letter and a base-plus-accent sequence; it does not perform the geometric placement of their glyphs.
Font hinting 2026-11-05
Font hinting guides the adjustment of a scaled outline font to the target pixel grid before rasterization. In TrueType, instructions can control how outline points move at a particular size and resolution. Grid fitting can preserve important strokes when faithful geometric scaling would leave them awkwardly positioned between pixels.[ref]
For an idealized example, two equal-width vertical strokes can overlap different fractions of neighboring pixels after scaling. Their rasterized darkness can then differ despite equal geometric widths. Coordinating the adjusted stroke positions and widths can make their displayed weights more consistent. The target depends on the requested size: a correction suitable for a small glyph need not be appropriate when many more pixels resolve its outline.
Font hinting changes the geometry used for rendering, rather than the underlying Unicode text or its grapheme clusters. Glyph substitution, glyph positioning and font hinting solve different parts of the path from encoded text to a visible image.
Glyph bearing 2026-11-05
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]
Put the origin at , the glyph advance at , and the ink edges at . Then
For , 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 .
Figure 1.
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.
Glyph positioning 2026-11-05
Glyph positioning assigns locations to the glyphs selected during text shaping. It specifies how each glyph is placed and how the logical pen position progresses through the text. A text baseline supplies a common reference for placing the shapes. An OpenType GPOS table can adjust horizontal and vertical placement, glyph advances and attachment between selected glyphs.[ref]
A simple coordinate model separates the two effects. Let be the pen position, a placement offset and the glyph advance. Draw glyph with its origin at
then update the logical position by
Changing moves the current shape; changing moves the starting position of subsequent shapes.
For example, a combining character can select an accent glyph that must be positioned above an earlier base glyph. The accent's placement and its glyph advance answer different questions. Kerning similarly changes spacing according to context, while glyph substitution changes which forms are selected. These choices precede the rasterization of the placed outlines into pixels.
Grid fitting 2026-11-05
Grid fitting adjusts scaled glyph geometry relative to a target pixel grid before rasterization. TrueType font hinting can move outline points to preserve important strokes and alignment at small sizes. The result depends on the requested resolution and transformation.[ref]
A simple area-coverage antialiasing model shows the problem. A vertical stroke from horizontal coordinate 0.4 to 1.6 covers 60 percent of each of two neighboring pixel columns. An equal-width stroke from 3.9 to 5.1 covers 10 percent, 100 percent and 10 percent of three columns. Both geometries have width 1.2 pixels, yet their darkest columns differ. Snapping their boundaries to give each stroke one full column changes the outlines but gives consistent displayed stroke weights.
This is a tradeoff between geometric fidelity and small-size legibility, rather than a change to the stored Unicode text. Grid fitting operates on the geometry supplied to the rasterization step; glyph substitution and glyph positioning address the forms and layout that precede it.
Figure 1.
Pixel coverage before and after grid fitting
. Original ideal area-coverage antialiasing model of rectangular strokes, not measurements of a particular computer font. The unfitted strokes both have width 1.2 pixels, but their placements give different column coverage. The fitted strokes each occupy one full column; their changed geometry is explicit. Red dashed lines mark the geometric stroke boundaries. Details.
Kerning 2026-11-05
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.[ref]
In a simplified horizontal pair model with default glyph advances and adjustment , the total advance is . A negative reduces the gap for that pair, while a positive 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.
Left side bearing 2026-11-05
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]
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.
Figure 1. . 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. Details.
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]
Mathematical typesetting 2026-11-05
Mathematical typesetting arranges symbolic expressions in two dimensions. It must coordinate computer fonts, glyph positioning, typesetting boxes and text baselines while preserving the expression's visible structure. A typeset fraction positions its components above and below a bar; superscripts, subscripts, square roots and mathematical delimiters impose other geometric relationships.[ref]
For example,
contains a superscript inside the upper component and a square root inside the lower component. Their dimensions help determine the height of the complete typeset fraction. A larger expression may then require larger surrounding mathematical delimiters. Laying out the smallest parts first makes this a recursive geometric construction.
An OpenType MATH table supplies font-specific information such as placement constants and suitable glyph variants. The table supplies data for layout; different implementations can use those data in different algorithms. TeX and LaTeX provide established authoring systems for expressing such mathematical structure.[ref]
Pen position 2026-11-05
In glyph positioning, the pen position is the logical point from which the next glyph is placed. The word pen describes a layout convention: the renderer can draw an outline or a collection of pixels rather than trace a physical pen stroke. Simple horizontal layout places this reference point on the text baseline.[ref]
Let be the current pen position, a placement offset and the resolved glyph advance. The current glyph's drawing origin and the next logical point are, respectively,
For example, in one horizontal coordinate system, , and draw at but leave the next logical point at . Moving the current shape and changing the progression of the run are separate operations.
A glyph's bounding box is therefore not a substitute for its pen position. A left side bearing can leave space between the logical origin and the ink, and a right side bearing records how the ink ends relative to the default advance. Kerning or attachment of a combining character can modify the placement or progression without changing the stored outline.
Right side bearing 2026-11-05
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 , then
Thus 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]
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.
TeX 2026-11-05
TeX is Donald E. Knuth's programmable system for typography, particularly mathematical typesetting. A document supplies text and instructions; TeX macros and TeX primitives build material whose dimensions determine the eventual page layout. Computer fonts supply glyphs and font metrics, while line breaking selects how a text paragraph is divided. The Knuth-Plass line-breaking algorithm is one of the system's central layout methods.[ref]
A TeX format supplies a prepared collection of definitions. Plain TeX and LaTeX provide different document interfaces built on TeX technology. For example, in Plain TeX the input $\sqrt{2}$\bye requests a square root expression, , and ends the document. The computer font, glyph positioning and mathematical typesetting rules determine the printed geometry; the source characters alone are not a picture of the result.
The TeXbook by Donald E. Knuth is the system's user and reference manual. TeX source code by Donald E. Knuth exposes the implementation as a documented computer program, making the paragraph algorithm and its numerical conventions inspectable.[ref]
Text baseline 2026-11-05
A text baseline is the reference line used to align glyphs in a run of text. It supplies a placement reference rather than the edge of every visible shape. In a horizontal coordinate system with the baseline at , a descender can extend below the line, while an ascender extends above the main body of a lowercase letter. Aligning ink bounding boxes at their bottom edges would therefore fail to align the writing.[ref]
The reference depends on the writing system and layout. OpenType distinguishes an alphabetic baseline (romn), a hanging baseline (hang) and a mathematical baseline (math), among others. The last is the reference about which mathematical forms are centred; it need not coincide with the alphabetic baseline. Vertical layout also requires an appropriate baseline convention.[ref]
For a simple horizontal run, start the logical pen position at on the chosen text baseline. A glyph advance moves the next pen position to . A vertical placement adjustment can move an accent glyph while leaving that baseline and the subsequent logical positions intact. This distinction lets glyph positioning align the run while placing individual forms precisely.
Text shaping 2026-11-05
Text shaping turns a sequence of Unicode text characters into a layout of glyphs from a chosen computer font. The result includes glyph indices, positions and glyph advances. A text character therefore does not determine a visible shape independently of its neighbors, writing system and selected computer font.[ref]
For example, the stored sequence f followed by i can become a single typographic ligature. Contextual Arabic forms illustrate a different requirement: a letter's neighbors influence the selected glyph. Glyph substitution chooses forms, while glyph positioning places the chosen forms; kerning adjusts their spacing. These operations can preserve the original Unicode text, so copying text should not be implemented by reading glyph indices as if they were code points.[ref]
Text shaping precedes rasterization: first determine what shapes to draw and where; then determine the pixels that represent those shapes at the requested size.