diff options
| author | Leedehai <18319900+Leedehai@users.noreply.github.com> | 2024-08-05 06:00:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-05 10:00:33 +0000 |
| commit | 33f13d78817dfb89134916f950323889fcc897aa (patch) | |
| tree | 4805abde624c08551ab957086c2c8fc20cb2039f | |
| parent | 6db95c633f65845ea1e53826092b7fa4e4ddbd0d (diff) | |
Fix historical ligatures for texts (#4603)
| -rw-r--r-- | crates/typst/src/text/mod.rs | 2 | ||||
| -rw-r--r-- | tests/ref/text-ligatures.png | bin | 345 -> 1157 bytes | |||
| -rw-r--r-- | tests/suite/layout/inline/text.typ | 10 |
3 files changed, 8 insertions, 4 deletions
diff --git a/crates/typst/src/text/mod.rs b/crates/typst/src/text/mod.rs index 76ea26c1..f2e525cf 100644 --- a/crates/typst/src/text/mod.rs +++ b/crates/typst/src/text/mod.rs @@ -1179,7 +1179,7 @@ pub(crate) fn features(styles: StyleChain) -> Vec<Feature> { } if TextElem::historical_ligatures_in(styles) { - feat(b"hilg", 1); + feat(b"hlig", 1); } match TextElem::number_type_in(styles) { diff --git a/tests/ref/text-ligatures.png b/tests/ref/text-ligatures.png Binary files differindex 6f0e286c..88720c89 100644 --- a/tests/ref/text-ligatures.png +++ b/tests/ref/text-ligatures.png diff --git a/tests/suite/layout/inline/text.typ b/tests/suite/layout/inline/text.typ index e2bc84ef..ba0e625e 100644 --- a/tests/suite/layout/inline/text.typ +++ b/tests/suite/layout/inline/text.typ @@ -12,8 +12,12 @@ a vs #text(alternates: true)[a] \ ß vs #text(stylistic-set: 5)[ß] --- text-ligatures --- -// Test ligatures. -fi vs. #text(ligatures: false)[No fi] +// Test text turning off (standard) ligatures of the font. +#text(ligatures: false)[fi Qu] vs fi Qu \ +// Test text turning on historical ligatures of the font. +abstract vs #text(historical-ligatures: true)[abstract] \ +// Test text turning on discretionary ligatures of the font. +waltz vs #text(discretionary-ligatures: true)[waltz] --- text-number-type --- // Test number type. @@ -34,7 +38,7 @@ fi vs. #text(ligatures: false)[No fi] 1/2 vs. #text(fractions: true)[1/2] --- text-features --- -// Test raw features. +// Test raw features array or dictionary. #text(features: ("smcp",))[Smcp] \ fi vs. #text(features: (liga: 0))[No fi] |
