pub struct PortableTexEngine<'resources> { /* private fields */ }Implementations§
Source§impl<'resources> PortableTexEngine<'resources>
impl<'resources> PortableTexEngine<'resources>
pub fn from_format<R>(format: &PortableFormatImage, resources: R) -> Selfwhere
R: ResourceProvider + 'resources,
pub fn with_font_platform<F>(self, fonts: F) -> Selfwhere
F: FontPlatform + 'resources,
pub fn with_platform<P>(self, platform: P) -> Selfwhere
P: PortablePlatform + 'resources,
Sourcepub fn initialize_format_state(&mut self) -> bool
pub fn initialize_format_state(&mut self) -> bool
Runs INITEX initialization, the only entry point that accepts an uninitialized state.
pub fn begin_primary_input(&mut self, name: &str, bytes: Vec<u8>) -> bool
pub fn run_main_control(&mut self) -> bool
pub fn run_format_initialization(&mut self) -> bool
Sourcepub fn begin_fragment_capture(&mut self)
pub fn begin_fragment_capture(&mut self)
Starts capturing a fragment root and drops the previous fragment’s host box records.
pub fn end_fragment_capture(&mut self)
pub fn snapshot_format(&self) -> PortableFormatImage
Sourcepub fn into_format(self) -> PortableFormatImage
pub fn into_format(self) -> PortableFormatImage
Seals this engine’s state in place as a format image, avoiding the copy Self::snapshot_format makes.
Sourcepub fn finalize_trie(&mut self) -> bool
pub fn finalize_trie(&mut self) -> bool
Packs the hyphenation trie as \dump would, false when it overflows, only once no more \patterns follow.
pub fn resource_request_count(&self) -> usize
pub fn resource_request_records(&self) -> &[PortableResourceRequestRecord]
pub fn transcript_bytes(&self) -> &[u8] ⓘ
Sourcepub fn primary_input_source_span(&self) -> Option<PortableSourceSpan>
pub fn primary_input_source_span(&self) -> Option<PortableSourceSpan>
The first interned span of the primary input, if any.
pub fn stripped_page_build_count(&self) -> usize
pub fn stripped_shipout_count(&self) -> usize
pub fn stripped_special_output_count(&self) -> usize
pub fn stripped_picture_load_count(&self) -> usize
pub fn stripped_source_special_count(&self) -> usize
pub fn stripped_write_whatsit_diagnostic_count(&self) -> usize
pub fn stripped_pdf_extension_count(&self) -> usize
pub fn stripped_page_top_prune_count(&self) -> usize
pub fn last_stripped_shipout_box(&self) -> Option<PortableNodeHandle>
pub fn captured_fragment_root(&self) -> Option<PortableNodeHandle>
Sourcepub fn host_box_record(&self, index: usize) -> Option<&PortableHostBox>
pub fn host_box_record(&self, index: usize) -> Option<&PortableHostBox>
Host box render payload by record id, as referenced by HostBoxRef marker nodes.
Sourcepub fn font_at_size(&self, font: i32) -> i32
pub fn font_at_size(&self, font: i32) -> i32
Size in scaled points font number font was loaded at.
Sourcepub fn font_name(&self, font: i32) -> Option<String>
pub fn font_name(&self, font: i32) -> Option<String>
The \font name of a font number, the XeTeX spec of a native font or the TFM name.
Sourcepub fn native_font_spec(&self, font: i32) -> Option<String>
pub fn native_font_spec(&self, font: i32) -> Option<String>
The spec a native font number was loaded with, from the font platform.
Sourcepub fn native_font_key(&self, font: i32) -> Option<u64>
pub fn native_font_key(&self, font: i32) -> Option<u64>
The host font key of a native font number, from the font platform.
Sourcepub fn native_font_table(&self) -> Vec<(PortableFontHandle, String, i32)>
pub fn native_font_table(&self) -> Vec<(PortableFontHandle, String, i32)>
The attached font platform’s native font table, packaged with a serialized format image.
Sourcepub fn restore_native_font_table(
&mut self,
table: &[(PortableFontHandle, String, i32)],
) -> bool
pub fn restore_native_font_table( &mut self, table: &[(PortableFontHandle, String, i32)], ) -> bool
Rebinds a loaded image’s native fonts from a Self::native_font_table snapshot, false when one fails.
pub fn last_abort_status(&self) -> Option<i32>
Sourcepub fn last_error_message(&self) -> Option<&str>
pub fn last_error_message(&self) -> Option<&str>
The message of the last run’s surfaced TeX error, None after a clean run or a bare abort.
Sourcepub fn last_error(&self) -> Option<&PortableError>
pub fn last_error(&self) -> Option<&PortableError>
The last run’s surfaced error with its kind and input position, None after a clean run or a bare abort.
Sourcepub fn set_sandbox(&mut self, on: bool)
pub fn set_sandbox(&mut self, on: bool)
Switches the fragment sandbox and resets its per run bookkeeping.
Sourcepub fn set_sandbox_op_budget(&mut self, budget: u64)
pub fn set_sandbox_op_budget(&mut self, budget: u64)
Sets the sandbox work budget, counted in commands, macro calls and expansions per run.
Sourcepub fn set_sandbox_wrapper_suffix(&mut self, start: Option<u32>)
pub fn set_sandbox_wrapper_suffix(&mut self, start: Option<u32>)
Marks where the host wrapper’s suffix starts in the primary input, as a byte offset.
Sourcepub fn snapshot_node(
&self,
handle: PortableNodeHandle,
) -> Option<PortableNodeSnapshot>
pub fn snapshot_node( &self, handle: PortableNodeHandle, ) -> Option<PortableNodeSnapshot>
Reads one node’s fields, None for a handle outside node memory.
Sourcepub fn set_source_tracking(&mut self, on: bool)
pub fn set_source_tracking(&mut self, on: bool)
Enables or disables source tracking, clearing every table so the calls around it may come in any order.
Sourcepub fn source_tracking_enabled(&self) -> bool
pub fn source_tracking_enabled(&self) -> bool
Whether source tracking is currently enabled.
Sourcepub fn node_enclosing_spans(
&self,
handle: PortableNodeHandle,
) -> Vec<PortableSourceSpan>
pub fn node_enclosing_spans( &self, handle: PortableNodeHandle, ) -> Vec<PortableSourceSpan>
Spans of the constructs strictly enclosing a node, innermost first and in the node’s own source.
Sourcepub fn input_source_spans(&self) -> Vec<PortableSourceSpan>
pub fn input_source_spans(&self) -> Vec<PortableSourceSpan>
Every interned span in display form.