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
//! Text shaping + atlas infrastructure. The unified RGBA glyph atlas
//! (color emoji + outline glyphs) lives in [`atlas`]; line measurement,
//! wrapping, and the `TextLayout` value backends consume live in
//! [`metrics`].
//!
//! The widget helpers (`h1`, `paragraph`, `text(...)`, …) live in
//! [`crate::widgets::text`] and compose against this module.
pub
pub use register_font;
/// Snap a logical-px coordinate to the nearest whole *physical* pixel.
///
/// Backends snap text **baselines** (and decoration-bar tops) with this
/// before emitting glyph quads: an unhinted MSDF glyph whose baseline
/// falls between device rows renders its horizontal features (baseline
/// stems, crossbars, the underline) as two half-covered rows, which
/// reads as per-line blur. Browsers snap baselines to device pixels for
/// the same reason. Horizontal placement stays fractional — X-snapping
/// would visibly un-even letter spacing, and vertical crispness doesn't
/// require it.
///
/// Non-positive `scale_factor` (defensive) returns `v` unchanged.