连字
将两个或多个字符合并为一个字形,可以是排版连字(通过OpenType的fi → fi)或Unicode字符(fi U+FB01)。阿拉伯文字使用强制连字。
What is a Ligature?
A ligature is a single glyph that replaces a sequence of two or more characters to improve their visual appearance or historical authenticity. The classic example is the fi ligature: when "f" and "i" appear together, the hook of the lowercase f can collide with the dot of the i. A well-designed font replaces this pair with a single unified glyph (fi) where the dot is absorbed into the f's arc.
Ligatures exist on a spectrum from purely aesthetic to semantically meaningful. Typographic ligatures (fi, fl, ffi, ffl, ft) exist solely for visual harmony. Historical ligatures like æ (ae) and œ (oe) started as ligatures but became independent characters with their own Unicode code points and linguistic identities.
Unicode Ligature Characters
Several common ligatures are encoded as standalone Unicode characters:
| Ligature | Unicode | Composed From |
|---|---|---|
| fi | U+FB01 | f + i |
| fl | U+FB02 | f + l |
| ffi | U+FB03 | f + f + i |
| ffl | U+FB04 | f + f + l |
| ſt | U+FB05 | long s + t |
| æ | U+00E6 | a + e (now independent) |
| œ | U+0153 | o + e (now independent) |
| ß | U+00DF | originally s + z ligature |
| & | U+0026 | et (Latin "and") ampersand |
The Unicode Standard includes these for compatibility with legacy encodings, but recommends using the component characters (fi) rather than the ligature code point (fi) for modern text — the font's OpenType rendering engine will apply the ligature automatically when appropriate.
How OpenType Ligatures Work
Modern fonts implement ligatures through OpenType GSUB (Glyph Substitution) tables. The font specifies rules: "when glyph IDs 42 and 46 appear in sequence, substitute glyph ID 312." This substitution happens invisibly in the text shaping pipeline.
OpenType defines several ligature feature tags:
liga— Standard ligatures (fi, fl): on by default in most renderersdlig— Discretionary ligatures (ct, st, Th): must be explicitly enabledhlig— Historical ligatures (long-s forms): for scholarly usecalt— Contextual alternates: character-level substitutions by context
Enable them in CSS:
/* Enable all standard and discretionary ligatures */
p {
font-variant-ligatures: common-ligatures discretionary-ligatures;
/* or shorthand: */
font-feature-settings: "liga" 1, "dlig" 1;
}
/* Disable ligatures (e.g., in code blocks) */
code {
font-variant-ligatures: no-common-ligatures;
}
Coding Fonts and Ligatures
Programming fonts like Fira Code, JetBrains Mono, and Cascadia Code use ligatures to render multi-character operators as unified symbols:
| Source Code | Rendered Ligature |
|---|---|
!= |
≠ |
>= |
≥ |
-> |
→ |
=> |
⇒ |
// |
∥ |
These are display-only — the underlying text remains !=, not ≠. This means search, copy-paste, and compilation are unaffected.
Quick Facts
| Property | Value |
|---|---|
| Classic typographic ligatures | fi, fl, ffi, ffl, ft, fj |
| Unicode ligature block | Alphabetic Presentation Forms (U+FB00–U+FB06) |
| OpenType feature for standard ligatures | liga |
| OpenType feature for discretionary | dlig |
| Ligatures in search | May break search; best to use component characters in HTML |
| Popular coding fonts with ligatures | Fira Code, JetBrains Mono, Cascadia Code, Hasklig |
| Historical origin | Medieval scribal practice of joining commonly paired letters |
相关术语
排版印刷 中的更多内容
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)。
字体渲染的字符视觉表现形式。一个字符可有多个字形(连字、上下文形式),一个字形也可表示多个字符。