Crate tectonic_xetex_format
source · [−]Expand description
Introspection into the internal data structures of the Tectonic/XeTeX TeX engine, with decoding of “format” files.
There are currently two main entrypoints to this crate. To introspect the
various internal structures provided by the engine, you can create an
engine::Engine
instance. One of its main capabilities is that it can
emit a C header defining the various magic constants needed for the engine
implementation:
let engine = tectonic_xetex_format::engine::Engine::default();
engine.emit_c_header(std::io::stdout()).unwrap();
You can also parse a TeX “format file” into a format::Format
struct to
examine saved engine state. This functionality isn’t yet fully implemented,
but many of the key pieces are present:
use std::{io::Read, fs::File};
use tectonic_errors::prelude::*;
use tectonic_xetex_format::format::Format;
let mut file = File::open("path-to-format-file.fmt")?;
let mut data = Vec::new();
file.read_to_end(&mut data)?;
let format = Format::parse(&data[..])?;
The intention is to add enough infrastructure so that all saved macros and
control strings can be decoded. On Linux systems, Tectonic’s auto-generated
format files are saved in the ~/.cache/Tectonic/formats/
directory.
Modules
#define
.