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 | |
| 31 | pub mod bib; |
| 32 | pub mod book; |
| 33 | pub mod compile; |
| 34 | pub mod delta; |
| 35 | pub mod diagram; |
| 36 | pub mod doc; |
| 37 | pub mod driver; |
| 38 | pub mod emit; |
| 39 | pub mod font; |
| 40 | pub mod fonts; |
| 41 | pub mod hyphenate; |
| 42 | pub mod image; |
| 43 | pub mod ir; |
| 44 | pub mod lang; |
| 45 | pub mod ledger; |
| 46 | pub mod linebreak; |
| 47 | pub mod math; |
| 48 | pub mod mathtable; |
| 49 | pub mod memo; |
| 50 | pub mod page; |
| 51 | pub mod plot; |
| 52 | pub mod table; |
| 53 | pub mod theme; |
| 54 | pub mod vfs; |
| 55 | pub 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"))] |
| 61 | pub mod wasm; |