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
//! Text shaping, layout, and drawing (feature `text`).
//!
//! Pure, tile-agnostic text machinery in the MapLibre mold, built on
//! `rustybuzz` (shaping) + `ttf-parser` (outlines) + `tiny-skia`
//! (rasterization) — no system-font access, so output is deterministic
//! and identical across native and wasm hosts.
//!
//! Two font backends share one fallback stack ([`StackEntry`]):
//!
//! - **Outline** ([`Font`]) — a real font file; rustybuzz shaping with
//! kerning/ligatures, vector-path rasterization at any size.
//! - **SDF** ([`SdfFontStack`]) — MapLibre glyph-PBF ranges from a
//! `glyphs` endpoint; 1 codepoint → 1 pre-rendered 24 px SDF bitmap,
//! MapLibre's fixed metrics. Lower fidelity, zero font files — see
//! [`sdf`] for the protocol constants and compat quirks. Arabic joins
//! through the Unicode presentation forms, the one shaping a
//! glyph stack can express.
//!
//! The pipeline is split in two so shaping cost is paid once per label
//! and drawing once per placement:
//!
//! 1. [`layout`] — transform / resolve bidi / itemize / shape /
//! line-break / reorder / anchor a string against the fallback
//! stack, producing a size-independent [`TextBlock`] in em units.
//! Its glyphs come out in visual order, left to right.
//! 2. [`draw`] — rasterize a [`TextBlock`] onto a `tiny_skia::PixmapMut`
//! at a given origin and font size, with fill color and optional halo.
//!
//! MapLibre `format` sections are supported: [`layout_sections`] lays out
//! per-section font (a subrange of the stack), `font-scale`, and
//! `vertical-align` (see [`VerticalAlign`]); a line's metrics scale by its
//! tallest section. [`draw`] takes a per-section fill table (see
//! [`SectionPaint`]).
//!
//! # Scope
//!
//! Deliberately not handled; callers should not expect them:
//!
//! - vertical writing mode
//! - color-emoji tables (`COLR` / `CBDT`) — such glyphs draw as their
//! monochrome outline, or not at all if the font has none
pub use presentation_forms;
pub use ;
pub use ;
pub use ;
pub use ;
pub use get_or_build_layout;
pub use ;
pub use ;
pub use ;
pub use ;