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
78
79
80
81
82
83
84
85
86
87
88
89
// SPDX-FileCopyrightText: Copyright (c) 2026 Mike Li/Mikewolfli/Wei Li(mikewolfli@163.com)
// SPDX-License-Identifier: MIT
//! The text layer: where glyphs come from, and which face wins.
//!
//! # Two questions, two types
//!
//! Rendering one character needs two answers that are easy to entangle and expensive to
//! separate later:
//!
//! 1. *"What are this character's pixels?"* — a [`GlyphSource`].
//! 2. *"I have several faces; which one answers?"* — a [`FontStack`], resolved first-hit.
//!
//! # Data is opt-in
//!
//! The default build carries **no font data** beyond the crate's historical 8x8 face, so it
//! draws Latin/ASCII and the fallback glyph for everything else — the same bytes it always
//! did. A face that covers more (today: `fonts-cjk-bitmap`, a generated 16x16 CJK subset) is
//! added by enabling a feature, which appends one entry to the stack. Nothing in this module
//! allocates, and no glyph table is ever resident in RAM: a resolved glyph borrows its rows
//! from the binary's read-only section.
// The opt-in vector faces (generated data) and the shaper that reads them. Both are gated by
// the shaping feature, because a face with no shaper to read it has no consumer.
// The one derivation of a line's clusters, shared by both renderers.
// Vector outline rasterisation (G-5): the coverage-producing implementation of `GlyphSource`.
//
// Gated on the shaping feature because it reads the same `ttf-parser` face data the shaper does —
// a rasteriser with no face to rasterise is dead weight, and `ttf-parser` is the shaper's own
// dependency, so this adds none.
pub use ;
// Colour bitmap faces (G-6): `CBDT`/`CBLC` plus the PNG decoder that reads what they point at.
//
// The two share one gate because they are one capability: a `CBDT` index is useless without a
// decoder for its payload, and a decoder with no index has nothing to decode. It also keeps
// `miniz_oxide` out of a build with no colour face.
pub use ColorBitmapFace;
// Bidirectional reordering (UAX #9). Always compiled: it is logic, not data.
// The generated CJK table is 75 KB of static data with no consumers unless the feature is on;
// compiling it unconditionally would be dead weight and a `dead_code` warning in one move.
pub use ;
pub use ColorBitmapSource;
// The wide-scalar table is a property of the characters, needed by the renderer's advance
// model *and* by a control's implicit-size estimate, so it is exported rather than copied.
// `estimate_cluster_advance` is exported for the same reason: it *is* the crate's advance
// model, and a second spelling of it would drift.
pub use ;
// The cluster helpers and the line-shaping entry point stay inside the crate: their consumers
// are the two backends and a control's implicit-size estimate, not public API.
pub use ;
// The greedy shaper is always present; the face-backed one only when a face is.
pub use RustybuzzShaper;
pub use cjk;