1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! parley layout -> `frust_scene` glyph-run conversion.
//!
//! This module owns the parley -> [`frust_scene::GlyphRun`] glyph-mapping
//! contract — the one `frust-engine`'s text lowering (`text/`, built on
//! `glifo`) consumes.
//!
//! # Coordinate convention
//!
//! Each emitted [`frust_scene::Glyph`] carries **run-local** coordinates that
//! are exactly what `glifo`'s own `Glyph` (`x`/`y`, each documented "offset in
//! run, relative to transform") expects:
//!
//! - `x` is the glyph's absolute horizontal position within its run, measured
//! from the run origin — parley's per-glyph advance offset plus the run's
//! `offset()` (the leading whitespace/indent before the first glyph). This is
//! the value produced by [`parley`]'s `positioned_glyphs()`.
//! - `y` is the glyph's baseline-relative vertical position with the line
//! baseline already applied (again via `positioned_glyphs()`), so glyphs on
//! the same line share a `y` and successive lines get distinct, increasing
//! `y` values.
//!
//! The block-level placement (`origin`, passed by the widget) is **not** baked
//! into the glyph coordinates; it lives on [`frust_scene::GlyphRun::transform`]
//! as a translation. The render backend applies that transform to the whole
//! run — the engine compiler composes it into the run's paint and its glyph
//! outlines alike (`frust-engine`'s `compile_glyph_run`). Keeping origin in the
//! transform (rather than added into every glyph) lets the scene builder compose
//! ancestor transforms cheaply (see `frust_scene::SceneBuilder::draw_glyph_run`).
use ;
use Brush;
use ;
/// Walks every line's glyph runs, mapping each into a scene glyph run whose
/// transform translates it to `origin`.
///
/// Inline boxes (not used in v1) are skipped. An empty or run-less layout
/// yields an empty vector.
pub