diff --git a/crates/typst-library/src/text/shaping.rs b/crates/typst-library/src/text/shaping.rs index 73ae07790..4fe6b49b8 100644 --- a/crates/typst-library/src/text/shaping.rs +++ b/crates/typst-library/src/text/shaping.rs @@ -451,11 +451,10 @@ impl<'a> ShapedText<'a> { .glyphs .last() .map(|g| g.range.end..g.range.end) - // In the unlikely chance that we hyphenate after an - // empty line, ensure that the glyph range still falls - // after self.base so that subtracting either of the - // endpoints by self.base doesn’t underflow. - // See . + // In the unlikely chance that we hyphenate after an empty line, + // ensure that the glyph range still falls after self.base so + // that subtracting either of the endpoints by self.base doesn't + // underflow. See . .unwrap_or_else(|| self.base..self.base); self.width += x_advance.at(self.size); self.glyphs.to_mut().push(ShapedGlyph { diff --git a/tests/ref/text/shaping.png b/tests/ref/text/shaping.png index a3ee750e3..69cba132d 100644 Binary files a/tests/ref/text/shaping.png and b/tests/ref/text/shaping.png differ diff --git a/tests/typ/text/shaping.typ b/tests/typ/text/shaping.typ index c794a105e..3a8d54110 100644 --- a/tests/typ/text/shaping.typ +++ b/tests/typ/text/shaping.typ @@ -26,9 +26,3 @@ ABCअपार्टमेंट // doesn't exist in shaping output. #set text(dir: rtl, font: "Noto Serif Hebrew") \ ט - ---- -// Test that #2283 is fixed. -#set text(font: "test", lang: "de", hyphenate: true, fallback: false) -#set par(linebreaks: "simple") -- ensure