summaryrefslogtreecommitdiff
path: root/crates/typst-layout/src/inline/shaping.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-01-24 13:11:26 +0100
committerGitHub <noreply@github.com>2025-01-24 12:11:26 +0000
commit26e65bfef5b1da7f6c72e1409237cf03fb5d6069 (patch)
treedae6f71efead43736202dd6aea933b95b1bc7a14 /crates/typst-layout/src/inline/shaping.rs
parent467968af0788a3059e1bed47f9daee846f5b3904 (diff)
Semantic paragraphs (#5746)
Diffstat (limited to 'crates/typst-layout/src/inline/shaping.rs')
-rw-r--r--crates/typst-layout/src/inline/shaping.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/typst-layout/src/inline/shaping.rs b/crates/typst-layout/src/inline/shaping.rs
index 2ed95f14..b688981a 100644
--- a/crates/typst-layout/src/inline/shaping.rs
+++ b/crates/typst-layout/src/inline/shaping.rs
@@ -29,7 +29,7 @@ use crate::modifiers::{FrameModifiers, FrameModify};
/// frame.
#[derive(Clone)]
pub struct ShapedText<'a> {
- /// The start of the text in the full paragraph.
+ /// The start of the text in the full text.
pub base: usize,
/// The text that was shaped.
pub text: &'a str,
@@ -66,9 +66,9 @@ pub struct ShapedGlyph {
pub y_offset: Em,
/// The adjustability of the glyph.
pub adjustability: Adjustability,
- /// The byte range of this glyph's cluster in the full paragraph. A cluster
- /// is a sequence of one or multiple glyphs that cannot be separated and
- /// must always be treated as a union.
+ /// The byte range of this glyph's cluster in the full inline layout. A
+ /// cluster is a sequence of one or multiple glyphs that cannot be separated
+ /// and must always be treated as a union.
///
/// The range values of the glyphs in a [`ShapedText`] should not overlap
/// with each other, and they should be monotonically increasing (for
@@ -405,7 +405,7 @@ impl<'a> ShapedText<'a> {
/// Reshape a range of the shaped text, reusing information from this
/// shaping process if possible.
///
- /// The text `range` is relative to the whole paragraph.
+ /// The text `range` is relative to the whole inline layout.
pub fn reshape(&'a self, engine: &Engine, text_range: Range) -> ShapedText<'a> {
let text = &self.text[text_range.start - self.base..text_range.end - self.base];
if let Some(glyphs) = self.slice_safe_to_break(text_range.clone()) {