字体
特定大小、字重和样式的字型实现,在数字排版中指包含字形定义和度量的字体文件(TTF、OTF、WOFF2)。
What is a Font?
A font is a collection of glyphs — visual representations of characters — designed with a unified visual style and packaged into a file that software can use to render text. In everyday speech "font" and "typeface" are used interchangeably, but there is a technical distinction: a typeface is the design family (e.g., Helvetica), while a font originally referred to a specific weight and size within that family (e.g., Helvetica Bold 12pt). In digital usage, a font file contains an entire typeface family or a single style within it.
Fonts are critical to Unicode rendering. No single font covers all 154,998 characters in Unicode 16.0. Instead, operating systems use font fallback chains: when a character is missing from the primary font, the renderer automatically substitutes a glyph from the next font in the chain that contains it.
Font File Formats
Modern fonts use the OpenType (.otf) or TrueType (.ttf) formats, which are functionally equivalent containers. Web fonts are distributed as WOFF (Web Open Font Format) or WOFF2 (compressed), which are wrappers around the same data.
| Format | Extension | Best For |
|---|---|---|
| TrueType | .ttf |
Windows/cross-platform compatibility |
| OpenType CFF | .otf |
PostScript-based outlines, print quality |
| WOFF | .woff |
Web delivery (legacy browsers) |
| WOFF2 | .woff2 |
Web delivery (modern, ~30% smaller) |
| Variable Font | .ttf or .otf |
Multiple weights/styles in one file |
Unicode Coverage
Every font has a Unicode coverage — the set of code points for which it provides glyphs. Tools like fc-query (Linux), Font Book (macOS), or online tools like Wakamai Fondue reveal exactly which characters a font covers.
Fonts designed for broad Unicode support include: - Noto (Google): aims for complete Unicode coverage across all scripts - GNU Unifont: bitmap font covering the entire Basic Multilingual Plane - DejaVu Sans: covers Latin, Greek, Cyrillic, and many symbols
Variable Fonts
OpenType 1.8 introduced variable fonts, which encode an entire design space (weight, width, slant, optical size) as a single file with interpolation axes. Instead of separate Bold, Light, and Condensed files, one variable font file can render any point along those axes. This reduces HTTP requests for web fonts and enables smooth typographic animations.
/* Variable font usage in CSS */
@font-face {
font-family: "Inter";
src: url("Inter.var.woff2") format("woff2-variations");
font-weight: 100 900;
}
h1 {
font-family: "Inter";
font-weight: 650; /* any value between 100–900 */
}
Quick Facts
| Property | Value |
|---|---|
| Typeface vs. font | Typeface = design family; font = specific file/style |
| Max Unicode 16.0 characters | 154,998 assigned code points |
| Most complete Unicode font | Noto (Google), GNU Unifont |
| Web font formats | WOFF2 (preferred), WOFF (fallback) |
| Variable font axis examples | wght (weight), wdth (width), ital (italic), opsz (optical size) |
| Font fallback mechanism | OS-level chain; controlled by font-family stack in CSS |
| CSS property for Unicode range | unicode-range in @font-face (subset loading) |
相关术语
排版印刷 中的更多内容
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),包括重音、变音符、软音符和波浪号等。
字体渲染的字符视觉表现形式。一个字符可有多个字形(连字、上下文形式),一个字形也可表示多个字符。
为视觉美观而调整特定字符对(如AV、To、LT)之间间距的操作,是字体特性而非Unicode概念,但会影响Unicode文本的渲染。