Docs: the functions the line layout fixes touch say what they do

This commit is contained in:
M Balazs PC
2026-11-07 19:30:49 +01:00
parent 66be035055
commit 4bfd7a207d
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -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);
+3
View File
@@ -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 = &paragraph.sg;