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

Truly basic definitions relating to the XeTeX engine.

Character category codes.

The low-level primitive commands provided by the engine.

The hash table for multi-letter control sequences.

Dimensional parameters defined by the engine.

The overall interface provided by the engine.

Enumerations within the engine.

The “equivalencies table”.

e-TeX penalties parameters defined by the engine.

Decode a format file.

Glue parameters defined by the engine.

Integer parameters defined by the engine.

“Local” parameters defined by the engine.

The TeX dynamic memory array.

Dealing with the TeX string table.

In this crate, a symbol is a number with an assigned name that is exposed to the engine implementation as a C preprocessor #define.

Handling TeX token lists.

Constants

The latest format version number supported by this version of the crate.

Type Definitions

A type for format file version numbers.