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    generated_node_to_fragment, EmptyGeneratedFontPlatform, EmptyGeneratedPlatform, GeneratedClock,
37    GeneratedFontHandle, GeneratedFontMetrics, GeneratedFontPlatform, GeneratedFontSystemAdapter,
38    GeneratedFormatCache, GeneratedHostBox, GeneratedHostBoxRequest, GeneratedHostBoxStyle,
39    GeneratedLayoutCapture, GeneratedLinebreakRequest, GeneratedNodeHandle, GeneratedNodeKind,
40    GeneratedNodeSnapshot, GeneratedNodeSourceSpan, GeneratedPlatform, GeneratedPlatformAdapter,
41    GeneratedResourceProvider, GeneratedResourceRequestRecord, GeneratedSourceSpan,
42};
43pub use mathtex_font as font;
44pub use mathtex_portable_engine_generated as portable_engine;
45pub use platform::{
46    CollectingDiagnosticSink, ConfigurablePlatform, Diagnostic, DiagnosticSeverity, DiagnosticSink,
47    HostBox, HostBoxGlyph, HostBoxRequest, HostBoxRule, HostBoxRun, HostBoxStyle, HostClock,
48    HostLimits, LimitError, LinebreakRequest, NoopDiagnosticSink, NoopPlatform, Platform,
49};
50pub use primitive::{PrimitiveEntry, PrimitiveRegistry, PrimitiveRegistryError};
51pub use profile::{
52    CatcodeDefaults, EngineKind, EnginePatch, EnginePatches, EngineProfile, EngineSemantics,
53    EtexProfile, ExtensionPolicy, FontSemantics, MathcodeDefaults, PrimitiveKind, PrimitiveOpcode,
54    PrimitiveSpec, ProfileId, RegisterDefaults, TexCore, TexProfile, XetexProfile,
55};
56#[cfg(feature = "std")]
57pub use resource::FileSystemResourceProvider;
58#[cfg(feature = "std")]
59pub use texmf::TexmfResources;
60pub use resource::{
61    InMemoryResourceProvider, OverlayResourceProvider, ResolverResourceProvider, Resource,
62    ResourceBundle, ResourceError, ResourceKind, ResourceProvider,
63    ResourceRequest as ProviderResourceRequest, ResourceRequestSource,
64};
65pub use resource_font::ResourceFontSystem;
66pub use session::{
67    BuildError, Engine, EngineBuilder, EngineError, EngineSession, FormatPreloadError,
68    FragmentInput,
69};