Computer font Created 2026-10-13 Updated 2026-11-05
A computer font stores data used to display text: glyph descriptions, spacing measurements, and mappings from text characters to glyphs. An OpenType computer font organizes these into separate tables. Its cmap table maps encoded text characters to default glyph indices; other tables can specify subsequent substitutions and positioning.
The separation permits several representations of a glyph. An outline font stores scalable boundaries, whereas a computer font can also contain images already sampled into pixels. The rendering system uses the selected representation and placement data to produce the visible text. A file containing glyph outlines therefore supplies more than a list of Unicode numbers.[ref]
Glyph Created 2026-10-13 Updated 2026-11-05
A glyph is a visual form used to display written content. A text character is the encoded abstract item; a glyph is the shape chosen for its presentation. One text character can have several glyphs, such as contextual forms in Arabic, while several text characters can be displayed by one typographic ligature.
For example, the two text characters “f” and “i” may be drawn separately or replaced by an “fi” typographic ligature. The underlying text can remain the same in both cases. A glyph index identifies a form within a particular computer font; it is not a portable Unicode code point.[ref]
Glyph index 2026-11-05
A glyph index is a numerical identifier for a glyph inside a particular computer font. It identifies an entry in that font's own glyph collection, rather than a Unicode code point. In an OpenType computer font, the cmap table maps character codes to default glyph indices; unavailable characters map to index zero, whose special .notdef glyph indicates missing coverage.[ref]
For a hypothetical example, one computer font might map U+0041 to index 37 while another maps the same character A to index 9. Both can display the correct letter. Carrying index 37 from the first computer font into the second can select an unrelated form. A later glyph substitution can also change the selected glyph index while leaving the underlying text characters unchanged. This distinction matters in rendering caches and when exchanging shaped text between systems.
Glyph substitution 2026-11-05
Glyph substitution replaces selected glyph indices by other glyph indices while laying out text. In OpenType, the GSUB table specifies these replacements after the default character-to-glyph index mapping. A substitution can replace one glyph by another, several by a typographic ligature, or one by several; its application can depend on surrounding glyphs.[ref]
For a hypothetical computer font, suppose f and i initially select indices17 and23. A matching ligature rule could replace the pair by index91. These numbers belong to that particular computer font; they do not change the stored Unicode sequence into code point91. The example also shows why substitution differs from kerning: replacing the pair selects a new shape, whereas adjusting the pair's positions can retain both original shapes.
Lookup order matters when one substitution creates or removes the input pattern for a later substitution. Text shaping must therefore interpret the applicable OpenType rules, rather than independently choosing a default glyph for each text character.
Grapheme cluster 2026-11-05
A grapheme cluster is a sequence of Unicode code points treated as a unit by a text-segmentation rule. Default extended grapheme clusters approximate user-perceived characters, supporting operations such as moving a text cursor or deleting a visible unit. They are not a universal linguistic definition of a text character; boundaries can require language-specific tailoring.[ref]
For example, e followed by the combining character U+0301 COMBINING ACUTE ACCENT contains two code points, but forms one default extended grapheme cluster. Its UTF-8 representation has three bytes: 65 CC 81 in hexadecimal notation. The precomposed U+00E9 also forms one grapheme cluster, with two UTF-8 bytes, C3 A9. The two representations correspond under the canonical rules of Unicode normalization.[ref]
A glyph count answers another question: text shaping can represent the two text characters f and i by one typographic ligature even though their default grapheme cluster boundary remains. Byte offsets, code point offsets, grapheme cluster boundaries and glyph indices therefore serve different purposes.
Figure 1. . Original encoding comparison for the accented letter é. Blue groups each contain one default extended grapheme cluster; Unicode normalization relates the precomposed and decomposed representations. The letter column shows the abstract letter represented, rather than a measurement of a particular text shaping engine. 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.
A mathematical glyph variant is an alternative ready-made glyph supplied for a mathematical shape at a different extent. In an OpenType MATH table, each MathGlyphVariantRecord pairs a glyph index with its advanceMeasurement along the extension direction.[ref]
Consider an invented set of vertical variants with construction measurements 900, 1300 and 1800 font units. A selection policy seeking the smallest variant at least 1200 units tall chooses 1300; a target of 1700 chooses 1800. A target of 2000 exceeds the set and may need a mathematical glyph assembly if the font supplies suitable parts.
This discrete choice is useful for growing mathematical delimiters around tall expressions. The numbers are an explanatory selection example, not measurements of an installed computer font. A separately drawn taller glyph can change proportions without requiring every stroke to undergo the same uniform enlargement.
OpenType 2026-11-05
OpenType is a table-based computer font format separating glyph representations, character mapping, measurements, naming metadata and optional layout rules. Its cmap table selects default glyph indices for encoded text characters; substitution and positioning tables support more elaborate text shaping.
An OpenType computer font can contain TrueType outlines or Compact Font Format outlines, and the specification also provides for bitmap and other glyph representations. The file format therefore does not prescribe a single kind of outline geometry. Extensions such as .ttf and .otf are useful conventions, but the actual table contents determine the available representation.[ref]
This organization lets one system answer separate questions: which glyph represents this text, how much space should it occupy, and how should it be drawn at this size? A language's contextual forms can change the first answer without changing the original Unicode text.
TeX character code 2026-11-05
A TeX character code is the numerical component identifying a character in TeX's character model. An ordinary character TeX token combines that code with a TeX category code. Classic TeX uses an eight-bit character-code range, 0–255.[ref]
For example, under the usual ASCII mapping, a has code 97. Reading it once with category 11 and again with category 12 produces the pairs and . The first component stays the same; the syntactic classification changes. This is why a TeX macro can distinguish inputs that look alike on the page.
The number does not identify a universal glyph. A computer font supplies the printed form, and a glyph index belongs to that font. The classic range should also not be treated as a restriction on every extended TeX engine.
Text character 2026-11-05
A text character is an abstract unit of written information, distinguished from its visible glyph and from the bytes used to store it. A Unicode code point identifies an encoded character; UTF-8 specifies a byte representation. Neither counting bytes nor counting code points always counts what a reader perceives as individual characters.[ref]
For example, an accented letter can be represented by a base letter followed by a combining accent. The sequence can be treated as one grapheme cluster, while a computer font and text shaping determine its displayed form. Conversely, the two text characters “f” and “i” can remain distinct in stored text while appearing as one typographic ligature. This is why a text editor's cursor movement, a byte offset and a glyph index answer different questions.
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.
Typographic ligature 2026-11-05
A typographic ligature combines two or more written forms into a single glyph. A familiar example is an “fi” shape joining the end of “f” to the following “i”. Its use can improve spacing or avoid a collision between the two shapes.
An OpenType shaping system can first map the separate text characters “f” and “i” to their default glyph indices, then apply a glyph substitution that replaces that pair by one ligature glyph index. The stored text need not be replaced by a special ligature character. Selection and copying can therefore preserve the original two-character sequence even though the display contains one glyph.[ref]
A typographic ligature also need not be produced merely by moving two glyphs closer together: substitution changes the selected form, whereas positioning changes where selected forms are drawn.