summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst-layout/src/math/text.rs13
-rw-r--r--tests/ref/issue-4828-math-number-multi-char.pngbin465 -> 461 bytes
-rw-r--r--tests/ref/issue-5489-matrix-stray-linebreak.pngbin644 -> 716 bytes
-rw-r--r--tests/ref/math-attach-kerning-mixed.pngbin2418 -> 2419 bytes
-rw-r--r--tests/ref/math-attach-limit-long.pngbin1941 -> 2060 bytes
-rw-r--r--tests/ref/math-attach-prescripts.pngbin670 -> 687 bytes
-rw-r--r--tests/ref/math-frac-precedence.pngbin3586 -> 3592 bytes
-rw-r--r--tests/ref/math-root-frame-size-index.pngbin902 -> 897 bytes
-rw-r--r--tests/ref/math-root-large-index.pngbin648 -> 640 bytes
9 files changed, 4 insertions, 9 deletions
diff --git a/crates/typst-layout/src/math/text.rs b/crates/typst-layout/src/math/text.rs
index 59ac5b08..7ecbcfba 100644
--- a/crates/typst-layout/src/math/text.rs
+++ b/crates/typst-layout/src/math/text.rs
@@ -65,18 +65,13 @@ fn layout_inline_text(
// Small optimization for numbers. Note that this lays out slightly
// differently to normal text and is worth re-evaluating in the future.
let mut fragments = vec![];
- let is_single = text.chars().count() == 1;
for unstyled_c in text.chars() {
let c = styled_char(styles, unstyled_c, false);
let mut glyph = GlyphFragment::new(ctx, styles, c, span);
- if is_single {
- // Duplicate what `layout_glyph` does exactly even if it's
- // probably incorrect here.
- match EquationElem::size_in(styles) {
- MathSize::Script => glyph.make_script_size(ctx),
- MathSize::ScriptScript => glyph.make_script_script_size(ctx),
- _ => {}
- }
+ match EquationElem::size_in(styles) {
+ MathSize::Script => glyph.make_script_size(ctx),
+ MathSize::ScriptScript => glyph.make_script_script_size(ctx),
+ _ => {}
}
fragments.push(glyph.into());
}
diff --git a/tests/ref/issue-4828-math-number-multi-char.png b/tests/ref/issue-4828-math-number-multi-char.png
index ff0a9bab..b365645d 100644
--- a/tests/ref/issue-4828-math-number-multi-char.png
+++ b/tests/ref/issue-4828-math-number-multi-char.png
Binary files differ
diff --git a/tests/ref/issue-5489-matrix-stray-linebreak.png b/tests/ref/issue-5489-matrix-stray-linebreak.png
index 2d278bd5..f4e41bf9 100644
--- a/tests/ref/issue-5489-matrix-stray-linebreak.png
+++ b/tests/ref/issue-5489-matrix-stray-linebreak.png
Binary files differ
diff --git a/tests/ref/math-attach-kerning-mixed.png b/tests/ref/math-attach-kerning-mixed.png
index 9d0bea27..64a54686 100644
--- a/tests/ref/math-attach-kerning-mixed.png
+++ b/tests/ref/math-attach-kerning-mixed.png
Binary files differ
diff --git a/tests/ref/math-attach-limit-long.png b/tests/ref/math-attach-limit-long.png
index b79e6ed4..555f9c66 100644
--- a/tests/ref/math-attach-limit-long.png
+++ b/tests/ref/math-attach-limit-long.png
Binary files differ
diff --git a/tests/ref/math-attach-prescripts.png b/tests/ref/math-attach-prescripts.png
index f0d21cb8..bcd60c0a 100644
--- a/tests/ref/math-attach-prescripts.png
+++ b/tests/ref/math-attach-prescripts.png
Binary files differ
diff --git a/tests/ref/math-frac-precedence.png b/tests/ref/math-frac-precedence.png
index fd16f2e6..bddcb43c 100644
--- a/tests/ref/math-frac-precedence.png
+++ b/tests/ref/math-frac-precedence.png
Binary files differ
diff --git a/tests/ref/math-root-frame-size-index.png b/tests/ref/math-root-frame-size-index.png
index 41d4df2e..f4704956 100644
--- a/tests/ref/math-root-frame-size-index.png
+++ b/tests/ref/math-root-frame-size-index.png
Binary files differ
diff --git a/tests/ref/math-root-large-index.png b/tests/ref/math-root-large-index.png
index 85689823..29dd478f 100644
--- a/tests/ref/math-root-large-index.png
+++ b/tests/ref/math-root-large-index.png
Binary files differ