diff options
| -rw-r--r-- | crates/typst-layout/src/math/text.rs | 13 | ||||
| -rw-r--r-- | tests/ref/issue-4828-math-number-multi-char.png | bin | 465 -> 461 bytes | |||
| -rw-r--r-- | tests/ref/issue-5489-matrix-stray-linebreak.png | bin | 644 -> 716 bytes | |||
| -rw-r--r-- | tests/ref/math-attach-kerning-mixed.png | bin | 2418 -> 2419 bytes | |||
| -rw-r--r-- | tests/ref/math-attach-limit-long.png | bin | 1941 -> 2060 bytes | |||
| -rw-r--r-- | tests/ref/math-attach-prescripts.png | bin | 670 -> 687 bytes | |||
| -rw-r--r-- | tests/ref/math-frac-precedence.png | bin | 3586 -> 3592 bytes | |||
| -rw-r--r-- | tests/ref/math-root-frame-size-index.png | bin | 902 -> 897 bytes | |||
| -rw-r--r-- | tests/ref/math-root-large-index.png | bin | 648 -> 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 Binary files differindex ff0a9bab..b365645d 100644 --- a/tests/ref/issue-4828-math-number-multi-char.png +++ b/tests/ref/issue-4828-math-number-multi-char.png diff --git a/tests/ref/issue-5489-matrix-stray-linebreak.png b/tests/ref/issue-5489-matrix-stray-linebreak.png Binary files differindex 2d278bd5..f4e41bf9 100644 --- a/tests/ref/issue-5489-matrix-stray-linebreak.png +++ b/tests/ref/issue-5489-matrix-stray-linebreak.png diff --git a/tests/ref/math-attach-kerning-mixed.png b/tests/ref/math-attach-kerning-mixed.png Binary files differindex 9d0bea27..64a54686 100644 --- a/tests/ref/math-attach-kerning-mixed.png +++ b/tests/ref/math-attach-kerning-mixed.png diff --git a/tests/ref/math-attach-limit-long.png b/tests/ref/math-attach-limit-long.png Binary files differindex b79e6ed4..555f9c66 100644 --- a/tests/ref/math-attach-limit-long.png +++ b/tests/ref/math-attach-limit-long.png diff --git a/tests/ref/math-attach-prescripts.png b/tests/ref/math-attach-prescripts.png Binary files differindex f0d21cb8..bcd60c0a 100644 --- a/tests/ref/math-attach-prescripts.png +++ b/tests/ref/math-attach-prescripts.png diff --git a/tests/ref/math-frac-precedence.png b/tests/ref/math-frac-precedence.png Binary files differindex fd16f2e6..bddcb43c 100644 --- a/tests/ref/math-frac-precedence.png +++ b/tests/ref/math-frac-precedence.png diff --git a/tests/ref/math-root-frame-size-index.png b/tests/ref/math-root-frame-size-index.png Binary files differindex 41d4df2e..f4704956 100644 --- a/tests/ref/math-root-frame-size-index.png +++ b/tests/ref/math-root-frame-size-index.png diff --git a/tests/ref/math-root-large-index.png b/tests/ref/math-root-large-index.png Binary files differindex 85689823..29dd478f 100644 --- a/tests/ref/math-root-large-index.png +++ b/tests/ref/math-root-large-index.png |
