Skip to main content

mathtex_engine/
lib.rs

1//! Portable TeX engine library for formats, sessions, IR emission, and host platform traits.
2#![cfg_attr(not(feature = "std"), no_std)]
3#![forbid(unsafe_code)]
4
5extern crate alloc;
6
7/// IR emitter that translates TeX shipout calls to layout nodes.
8pub mod emit;
9/// Format image serialization, deserialization, and snapshot types.
10pub mod format;
11/// Code generated from the WEB source: engine tables, dispatch, and node types.
12pub mod generated;
13/// Host platform trait and bundled implementations for diagnostics, limits, and clocks.
14pub mod platform;
15/// Registry mapping primitive names to dispatch opcodes.
16pub mod primitive;
17/// Engine profile definitions: catcodes, primitives, semantics, and patches.
18pub mod profile;
19/// Resource provider trait and bundled implementations for fonts, packages, and inputs.
20pub mod resource;
21/// Font adapter that loads bytes through a resource provider.
22pub mod resource_font;
23/// Engine session construction, execution, and fragment rendering.
24pub mod session;
25#[cfg(feature = "std")]
26/// Native filesystem resource provider backed by a TeX live tree and `ls-R` index.
27pub mod texmf;
28
29pub use emit::{EmitNode, IrEmitter};
30pub use format::{
31    FormatImage, FormatInitError, FormatInitializer, FormatPackage, FormatResource,
32    FormatResourceKind, FormatSnapshot, FormatState, MacroDefinition, RegisterSnapshot,
33    SessionState,
34};
35pub use generated::{
36    bake_packaged_format, generated_node_to_fragment, BakedGeneratedFormat,
37    EmptyGeneratedFontPlatform, EmptyGeneratedPlatform, GeneratedClock, GeneratedFontHandle,
38    GeneratedFontMetrics, GeneratedFontPlatform, GeneratedFontSystemAdapter, GeneratedFormatCache,
39    GeneratedHostBox, GeneratedHostBoxRequest, GeneratedHostBoxStyle, GeneratedLayoutCapture,
40    GeneratedLinebreakRequest, GeneratedNodeHandle, GeneratedNodeKind, GeneratedNodeSnapshot,
41    GeneratedNodeSourceSpan, GeneratedPlatform, GeneratedPlatformAdapter,
42    GeneratedResourceProvider, GeneratedResourceRequestRecord, GeneratedSourceSpan,
43};
44pub use mathtex_font as font;
45pub use mathtex_portable_engine_generated as portable_engine;
46pub use platform::{
47    CollectingDiagnosticSink, ConfigurablePlatform, Diagnostic, DiagnosticSeverity, DiagnosticSink,
48    HostBox, HostBoxGlyph, HostBoxRequest, HostBoxRule, HostBoxRun, HostBoxStyle, HostClock,
49    HostLimits, LimitError, LinebreakRequest, NoopDiagnosticSink, NoopPlatform, Platform,
50};
51pub use primitive::{PrimitiveEntry, PrimitiveRegistry, PrimitiveRegistryError};
52pub use profile::{
53    CatcodeDefaults, EngineKind, EnginePatch, EnginePatches, EngineProfile, EngineSemantics,
54    EtexProfile, ExtensionPolicy, FontSemantics, MathcodeDefaults, PrimitiveKind, PrimitiveOpcode,
55    PrimitiveSpec, ProfileId, RegisterDefaults, TexCore, TexProfile, XetexProfile,
56};
57#[cfg(feature = "std")]
58pub use resource::FileSystemResourceProvider;
59pub use resource::{
60    InMemoryResourceProvider, OverlayResourceProvider, ResolverResourceProvider, Resource,
61    ResourceBundle, ResourceError, ResourceKind, ResourceProvider,
62    ResourceRequest as ProviderResourceRequest, ResourceRequestSource,
63};
64pub use resource_font::ResourceFontSystem;
65pub use session::{
66    BuildError, Engine, EngineBuilder, EngineError, EngineSession, FormatPreloadError,
67    FragmentInput,
68};
69#[cfg(feature = "std")]
70pub use texmf::TexmfResources;