OpenType
Modern font format developed by Microsoft and Adobe supporting up to 65,535 glyphs, advanced typographic features (ligatures, alternates, kerning), and Unicode-based character mapping.
What is OpenType?
OpenType is the dominant font format for digital typography, developed jointly by Microsoft and Adobe in the mid-1990s and now governed by the OpenType Specification (part of the ISO/IEC 14496-22 standard, "Open Font Format"). OpenType extends the earlier TrueType format by adding support for advanced typographic features, broader Unicode coverage, and multiple outline formats within a single container.
An OpenType font file (.otf, .ttf) is a binary container of structured tables, each encoding a different aspect of the font's data.
Core Tables
cmap — Character to Glyph Mapping
The cmap table is the bridge between Unicode code points and the font's internal glyph IDs. It contains one or more subtables, the most important being Format 4 (for BMP characters, U+0000–U+FFFF) and Format 12 (for full Unicode, including supplementary characters). When a renderer needs to display a character, it looks up the code point in cmap to get a glyph ID, then uses other tables to render that glyph.
GSUB — Glyph Substitution
The GSUB table enables glyph substitution rules — replacing one or more glyph IDs with others. This is how typographic features like ligatures, small capitals, contextual alternates, and stylistic sets work. GSUB rules are organized into feature tags (4-character codes) and applied based on the script and language of the text.
liga → Standard Ligatures (fi → fi, fl → fl)
smcp → Small Capitals (a → ᴀ)
calt → Contextual Alternates (context-sensitive glyph swaps)
onum → Oldstyle Figures (3 → ³ styled digits)
GPOS — Glyph Positioning
The GPOS table defines positioning adjustments — moving glyphs relative to each other for kerning, mark attachment (diacritic positioning), and cursive attachment. The kern feature historically used a separate kern table, but modern fonts use GPOS for more precise and contextual kerning.
CFF vs. TrueType Outlines
OpenType supports two outline formats:
| Format | Extension | Developer | Curve Type |
|---|---|---|---|
| TrueType outlines | .ttf | Apple/Microsoft | Quadratic Bézier splines |
| CFF (PostScript) outlines | .otf | Adobe | Cubic Bézier curves |
TrueType fonts include hinting instructions for pixel-grid alignment at small sizes. CFF fonts rely on the font rasterizer's autohinting. At high resolutions (Retina/HiDPI), the difference is negligible; at 12–16px, hinting quality can be visually significant.
Variable Fonts
OpenType 1.8 introduced variable fonts (also known as OpenType Font Variations), allowing a single font file to encode a continuous design space along one or more axes:
wght— Weight (100–900)wdth— Width (condensed to expanded)ital— Italic (upright to italic)- Custom axes (e.g., optical size
opsz, x-heightxhgt)
/* Variable font usage in CSS */
@font-face {
font-family: "MyVariable";
src: url("font.woff2") format("woff2-variations");
font-weight: 100 900;
}
h1 { font-weight: 650; } /* Any value in the supported range */
Quick Facts
| Property | Value |
|---|---|
| Standard | OpenType Specification / ISO/IEC 14496-22 |
| File extensions | .otf (CFF), .ttf (TrueType), .woff2 (web) |
| Unicode mapping table | cmap |
| Glyph substitution table | GSUB (ligatures, small caps, contextual alternates) |
| Glyph positioning table | GPOS (kerning, mark attachment) |
| Outline formats | TrueType (quadratic) and CFF (cubic Bézier) |
| Variable fonts | OpenType 1.8+ (design axes: weight, width, etc.) |
相关术语
排版印刷 中的更多内容
CSS @font-face descriptor specifying which Unicode code points a font should cover. …
The mechanism by which a rendering engine substitutes glyphs from a secondary …
字符从右向左流动的文本方向,用于阿拉伯语、希伯来语、塔阿纳等文字,正确显示需要双向算法。
Fonts downloaded by the browser to render text, declared via CSS @font-face. …
U+00A0,防止在该位置换行的空格。HTML中为 ,用于数字与单位之间(100 km)、专有名词(Mr. Smith)和缩写之后。
全角(Em):等于字号的宽度;半角(En):全角的一半,用于定义全角破折号宽度、全角空格、半角空格和CSS单位(1em、0.5em)。
附加在字母上以改变发音或意义的符号,可以是预组合形式(é U+00E9)或组合形式(e + ◌́ U+0065+U+0301),包括重音、变音符、软音符和波浪号等。
特定大小、字重和样式的字型实现,在数字排版中指包含字形定义和度量的字体文件(TTF、OTF、WOFF2)。
字体渲染的字符视觉表现形式。一个字符可有多个字形(连字、上下文形式),一个字形也可表示多个字符。
为视觉美观而调整特定字符对(如AV、To、LT)之间间距的操作,是字体特性而非Unicode概念,但会影响Unicode文本的渲染。