diff options
| author | A-Walrus <58790821+A-Walrus@users.noreply.github.com> | 2024-04-09 14:49:38 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-09 11:49:38 +0000 |
| commit | 847b710480d388b890f13c2c0a20c4e8b7e16cc2 (patch) | |
| tree | 8d59ad446c80560e9cdf6fd5890951cbcac601c7 /crates | |
| parent | 7ea55ec9a09c6ca92eb272f99c03499d1cdd5ee3 (diff) | |
Fix raw bidi text (#3885)
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst/src/layout/inline/mod.rs | 10 | ||||
| -rw-r--r-- | crates/typst/src/text/raw.rs | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/crates/typst/src/layout/inline/mod.rs b/crates/typst/src/layout/inline/mod.rs index 3587c250..fd1e60db 100644 --- a/crates/typst/src/layout/inline/mod.rs +++ b/crates/typst/src/layout/inline/mod.rs @@ -450,10 +450,10 @@ fn collect<'a>( let prev = full.len(); let dir = TextElem::dir_in(styles); if dir != outer_dir { - // Insert "Explicit Directional Isolate". + // Insert "Explicit Directional Embedding". match dir { - Dir::LTR => full.push('\u{2066}'), - Dir::RTL => full.push('\u{2067}'), + Dir::LTR => full.push('\u{202A}'), + Dir::RTL => full.push('\u{202B}'), _ => {} } } @@ -465,8 +465,8 @@ fn collect<'a>( } if dir != outer_dir { - // Insert "Pop Directional Isolate". - full.push('\u{2069}'); + // Insert "Pop Directional Formatting". + full.push('\u{202C}'); } Segment::Text(full.len() - prev) } else if let Some(elem) = child.to_packed::<HElem>() { diff --git a/crates/typst/src/text/raw.rs b/crates/typst/src/text/raw.rs index f0105363..dc288a66 100644 --- a/crates/typst/src/text/raw.rs +++ b/crates/typst/src/text/raw.rs @@ -443,6 +443,7 @@ impl ShowSet for Packed<RawElem> { fn show_set(&self, styles: StyleChain) -> Styles { let mut out = Styles::new(); out.set(TextElem::set_overhang(false)); + out.set(TextElem::set_lang(Lang::ENGLISH)); out.set(TextElem::set_hyphenate(Hyphenate(Smart::Custom(false)))); out.set(TextElem::set_size(TextSize(Em::new(0.8).into()))); out.set(TextElem::set_font(FontList(vec![FontFamily::new("DejaVu Sans Mono")]))); |
