字形
字体渲染的字符视觉表现形式。一个字符可有多个字形(连字、上下文形式),一个字形也可表示多个字符。
What is a Glyph?
A glyph is the specific visual form that a character takes when rendered on screen or in print. While a character is an abstract concept — the letter "A" as defined by Unicode — a glyph is the concrete, drawn shape that a particular font uses to represent it. One character can have many glyphs; one glyph can represent many characters.
This distinction matters deeply in typography and software rendering. The letter "a" has two common glyph forms: a single-story form (a simple curve and stem) and a double-story form (with a closed bowl and ear). Both glyphs represent the same Unicode character U+0061, but they look entirely different depending on the font.
How Glyphs Work
A font file is essentially a database of glyphs. Each glyph is defined as a set of vector outlines (in formats like TrueType or PostScript) that a rendering engine scales, hints, and rasterizes to produce pixels on screen. The font also contains metadata about each glyph: its advance width (how much horizontal space it occupies), side bearings (padding on left and right), and positioning rules for when it appears next to other glyphs.
When you type text, the operating system's text shaping engine (such as HarfBuzz or CoreText) maps each Unicode code point to a glyph ID within the font. This process is called shaping, and it can be surprisingly complex — a single code point might map to different glyphs depending on context (initial, medial, final forms in Arabic), and a sequence of code points might collapse into a single glyph (a ligature).
Glyphs vs. Characters
| Concept | Example | Unicode |
|---|---|---|
| Character | Latin letter A | U+0041 |
| Glyph (serif) | A rendered in Times New Roman |
font-internal ID |
| Glyph (sans) | A rendered in Helvetica |
font-internal ID |
| Ligature glyph | fi as a single shape |
maps to U+0066 + U+0069 |
A font may contain glyphs for characters it does not natively support — fallback glyphs, .notdef (the box or question mark shown for missing characters), and ornamental alternates. OpenType fonts can also include multiple glyph variants for a single character, accessible via features like ss01–ss20 (stylistic sets) or swsh (swashes).
Practical Examples
In web development, when you use font-variant: small-caps, the browser either uses dedicated small-cap glyphs from the font's OpenType tables or synthesizes them by scaling uppercase glyphs — a lesser-quality fallback. This is why the glyph distinction matters for high-quality typography.
In emoji rendering, a single code point (e.g., U+1F600 😀) maps to a color glyph in an emoji font. Different platforms provide entirely different glyph designs for the same character, which is why the same emoji looks different on iOS vs. Android.
Quick Facts
| Property | Value |
|---|---|
| Formal definition | Visual representation of a character as rendered by a font |
| Unicode term | Defined in Unicode Standard, Chapter 2 |
| Related concepts | Character, code point, font, ligature, rendering |
| Missing glyph indicator | .notdef glyph (typically □ or ?) |
| Glyph database format | TrueType (.ttf), OpenType (.otf), WOFF/WOFF2 (web) |
| Shaping engines | HarfBuzz, CoreText (macOS/iOS), DirectWrite (Windows) |
| OpenType glyph variants | Stylistic sets (ss01–ss20), alternates (calt, swsh) |
相关术语
排版印刷 中的更多内容
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 …
Modern font format developed by Microsoft and Adobe supporting up to 65,535 …
字符从右向左流动的文本方向,用于阿拉伯语、希伯来语、塔阿纳等文字,正确显示需要双向算法。
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文本的渲染。