mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-11 02:19:56 -06:00
Docs: the functions the line layout fixes touch say what they do
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user