From 4bfd7a207d20820700a065912078e921fbb65786 Mon Sep 17 00:00:00 2001 From: M Balazs PC Date: Sat, 7 Nov 2026 19:30:49 +0100 Subject: [PATCH] Docs: the functions the line layout fixes touch say what they do --- crates/eps/src/import/ate.rs | 4 ++++ crates/text/src/layout/flow.rs | 3 +++ 2 files changed, 7 insertions(+) diff --git a/crates/eps/src/import/ate.rs b/crates/eps/src/import/ate.rs index f3061bb75..fc78f6ee2 100644 --- a/crates/eps/src/import/ate.rs +++ b/crates/eps/src/import/ate.rs @@ -1034,6 +1034,8 @@ impl Story { } } +/// The paragraph style of paragraph attributes `p`, its lengths (indents, spacing, the +/// hyphenation zone) scaled by `scale`, as sizes are. fn para_style(p: &Para, scale: f64) -> ParaStyle { ParaStyle { justify: match p.justify { @@ -1066,6 +1068,8 @@ fn para_style(p: &Para, scale: f64) -> ParaStyle { } } +/// The character style of character attributes `s`: its font from the fonts the app has, its +/// lengths (size, leading, baseline shift, stroke width) scaled by `scale`. fn char_style(s: &Style, scale: f64) -> CharStyle { let (family, style) = s.font.as_deref().map_or_else(|| (CharStyle::default().font_family, "Regular".to_string()), crate::family_style); let family = vectorcraft_text::FontDb::global().find_family(&family).unwrap_or(family); diff --git a/crates/text/src/layout/flow.rs b/crates/text/src/layout/flow.rs index 42232f449..2ed8e3365 100644 --- a/crates/text/src/layout/flow.rs +++ b/crates/text/src/layout/flow.rs @@ -436,6 +436,9 @@ fn run_paragraph_lines(cx: &mut Ctx<'_>, pen: &mut Pen<'_>, t: &TextObject, mut true } +/// The geometry of the line of `paragraph` from glyph `index`, placed at `position`: where it +/// ends with its trailing spaces trimmed, its hyphen, its room and margins, the glyphs that hang or +/// stay out of justification, and whether it is the paragraph's last line. fn prepare_line_geometry(cx: &Ctx<'_>, t: &TextObject, paragraph: &ParagraphData<'_, '_>, position: LinePosition, index: usize) -> LineGeometry { let para = paragraph.para; let sg = ¶graph.sg;