diff options
| author | Tobias Rapp <t-rapp@users.noreply.github.com> | 2024-01-25 16:08:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-25 15:08:22 +0000 |
| commit | b4b17871d6a6dbda40588eb04619a65db7c0a6b6 (patch) | |
| tree | 746e82bff3d9fe129cc3443dfe28559110e0bc74 | |
| parent | ff6da491c81b03666d47c339132fad5c8bedf528 (diff) | |
Add symbol name for narrow non-breaking space (#3217)
| -rw-r--r-- | crates/typst/src/symbols/sym.rs | 1 | ||||
| -rw-r--r-- | tests/ref/text/linebreak.png | bin | 39452 -> 44823 bytes | |||
| -rw-r--r-- | tests/typ/text/linebreak.typ | 9 |
3 files changed, 10 insertions, 0 deletions
diff --git a/crates/typst/src/symbols/sym.rs b/crates/typst/src/symbols/sym.rs index ed70b963..59fa2931 100644 --- a/crates/typst/src/symbols/sym.rs +++ b/crates/typst/src/symbols/sym.rs @@ -24,6 +24,7 @@ pub(crate) const SYM: &[(&str, Symbol)] = symbols! { space: [ ' ', nobreak: '\u{A0}', + nobreak.narrow: '\u{202F}', en: '\u{2002}', quad: '\u{2003}', third: '\u{2004}', diff --git a/tests/ref/text/linebreak.png b/tests/ref/text/linebreak.png Binary files differindex 1e94762b..3dd2fc15 100644 --- a/tests/ref/text/linebreak.png +++ b/tests/ref/text/linebreak.png diff --git a/tests/typ/text/linebreak.typ b/tests/typ/text/linebreak.typ index 7e409a80..2ddeb9ed 100644 --- a/tests/typ/text/linebreak.typ +++ b/tests/typ/text/linebreak.typ @@ -9,6 +9,15 @@ This is a spaceexceedinglylongy. Supercalifragilisticexpialidocious Expialigoricmetrioxidation. --- +// Test for non-breaking space and hyphen. +There are non\u{2011}breaking~characters. + +--- +// Test for narrow non-breaking space. +#show "_": sym.space.nobreak.narrow +0.1_g, 1_g, 10_g, 100_g, 1_000_g, 10_000_g, 100_000_g, 1_000_000_g + +--- // Test that there are no unwanted line break opportunities on run change. This is partly emp#emph[has]ized. |
