Oregami
Repositories/oxedyne/fe2o3

oxedyne/fe2o3/fe2o3_austenite/src/lib.rs

2.7 KiB, 32 runs

created by r1870400018:35669, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1//! Austenite: a streaming, two-pass typesetting engine.
2//!
3//! This crate began as the Phase 0 spine -- a walking skeleton, not a typesetter. It carries a
4//! box/glue/penalty intermediate representation, a jdat ledger of anchors, and a two-pass driver
5//! whose convergence loop is honest about how it terminates. Pages are emitted as SVG through
6//! `fe2o3_graphics`. Phase 1 wires the metric seam to `fe2o3_font`: real text is shaped with
7//! HarfBuzz, measured against a real face, and drawn as glyph outlines (see [`font`]). Knuth-Plass
8//! total-fit line breaking sets a paragraph into justified lines (see [`linebreak`]). Pearl output
9//! has a v0 spike (see [`emit::pearl`]): `austenite --pearl` writes a content-addressed `.prl` -- glyph
10//! outlines stored once, each page a view over a block, the ledger inside -- which `pearl_render` reads
11//! back to the SVG arm's own bytes.
12//!
13//! The design is set out in `doc/Austenite/sec_architecture.typ` and `sec_decisions.typ`. Two
14//! commitments from there shape every type below:
15//!
16//! * *Stratify hard.* Layout facts reach nothing outside the engine except through the ledger, and
17//! only through anchor classes known in advance. There is no query, no state, no `counter.at`.
18//! * *Scaled integers.* All lengths are integers in scaled units, as in TeX, never floating point,
19//! so a break decision is exact and a build is reproducible. See [`ir::Sp`].
20//!
21//! A note on units and `fe2o3_geom`. The architecture mandates a *signed* scaled-integer length
22//! (a kern, a glue shrink and a depth below the baseline are all naturally negative or paired with
23//! a negative). `fe2o3_geom::dim::Dim` is an unsigned `usize` built for terminal and widget layout,
24//! so it cannot carry that model. The typographic core therefore uses [`ir::Sp`]; `fe2o3_geom` is
25//! kept for the device-space output boundary, where extents are non-negative (see
26//! [`page::PageGeometry::media_box`]).
27//!
28//! [Written with AI entirely](https://need2know.ai/entirely-ai/code)\
29//! Anthropic Claude
30
31pub mod bib;
32pub mod book;
33pub mod compile;
34pub mod delta;
35pub mod diagram;
36pub mod doc;
37pub mod driver;
38pub mod emit;
39pub mod font;
40pub mod fonts;
41pub mod hyphenate;
42pub mod image;
43pub mod ir;
44pub mod lang;
45pub mod ledger;
46pub mod linebreak;
47pub mod math;
48pub mod mathtable;
49pub mod memo;
50pub mod page;
51pub mod plot;
52pub mod table;
53pub mod theme;
54pub mod vfs;
55pub mod watch;
56
57// The wasm-bindgen compile surface, built only for the wasm target under the `wasm` feature: the
58// dependencies it needs (wasm-bindgen, js-sys) are confined to `cfg(target_arch = "wasm32")`, so a
59// native build never pulls them in whether or not the feature is set.
60#[cfg(all(feature = "wasm", target_arch = "wasm32"))]
61pub mod wasm;