Fix raw bidi text (#3885)
This commit is contained in:
parent
fcd7705fb6
commit
8e025c9cdf
@ -450,10 +450,10 @@ fn collect<'a>(
|
|||||||
let prev = full.len();
|
let prev = full.len();
|
||||||
let dir = TextElem::dir_in(styles);
|
let dir = TextElem::dir_in(styles);
|
||||||
if dir != outer_dir {
|
if dir != outer_dir {
|
||||||
// Insert "Explicit Directional Isolate".
|
// Insert "Explicit Directional Embedding".
|
||||||
match dir {
|
match dir {
|
||||||
Dir::LTR => full.push('\u{2066}'),
|
Dir::LTR => full.push('\u{202A}'),
|
||||||
Dir::RTL => full.push('\u{2067}'),
|
Dir::RTL => full.push('\u{202B}'),
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -465,8 +465,8 @@ fn collect<'a>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if dir != outer_dir {
|
if dir != outer_dir {
|
||||||
// Insert "Pop Directional Isolate".
|
// Insert "Pop Directional Formatting".
|
||||||
full.push('\u{2069}');
|
full.push('\u{202C}');
|
||||||
}
|
}
|
||||||
Segment::Text(full.len() - prev)
|
Segment::Text(full.len() - prev)
|
||||||
} else if let Some(elem) = child.to_packed::<HElem>() {
|
} else if let Some(elem) = child.to_packed::<HElem>() {
|
||||||
|
@ -443,6 +443,7 @@ impl ShowSet for Packed<RawElem> {
|
|||||||
fn show_set(&self, styles: StyleChain) -> Styles {
|
fn show_set(&self, styles: StyleChain) -> Styles {
|
||||||
let mut out = Styles::new();
|
let mut out = Styles::new();
|
||||||
out.set(TextElem::set_overhang(false));
|
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_hyphenate(Hyphenate(Smart::Custom(false))));
|
||||||
out.set(TextElem::set_size(TextSize(Em::new(0.8).into())));
|
out.set(TextElem::set_size(TextSize(Em::new(0.8).into())));
|
||||||
out.set(TextElem::set_font(FontList(vec![FontFamily::new("DejaVu Sans Mono")])));
|
out.set(TextElem::set_font(FontList(vec![FontFamily::new("DejaVu Sans Mono")])));
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 31 KiB |
@ -54,6 +54,16 @@ Lריווח #h(1cm) R
|
|||||||
#linebreak()
|
#linebreak()
|
||||||
ב #text("12:00 - 13:00",dir:ltr) בצהריים
|
ב #text("12:00 - 13:00",dir:ltr) בצהריים
|
||||||
|
|
||||||
|
---
|
||||||
|
// Mixing raw
|
||||||
|
#set text(lang: "he")
|
||||||
|
לדוג. `if a == b:` זה תנאי
|
||||||
|
#set raw(lang:"python")
|
||||||
|
לדוג. `if a == b:` זה תנאי
|
||||||
|
|
||||||
|
#show raw: set text(dir:rtl)
|
||||||
|
לתכנת בעברית `אם א == ב:`
|
||||||
|
|
||||||
---
|
---
|
||||||
// Test setting a vertical direction.
|
// Test setting a vertical direction.
|
||||||
// Ref: false
|
// Ref: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user