Skip to main content

DviWriter

Struct DviWriter 

Source
pub struct DviWriter { /* private fields */ }
Expand description

The state of the DVI file being written.

Implementations§

Source§

impl DviWriter

Source

pub fn pages(&self) -> u32

The number of pages written so far.

Source

pub fn begin_page( &mut self, engine: &mut Engine, dims: (i32, i32, i32), offsets: (i32, i32), )

Starts a page (§640): writes the preamble before the first page, then bop with \count0–\count9. width, height and depth are the box dimensions, h_off and v_off the page offsets.

Source

pub fn end_page(&mut self)

Finishes a page.

Source

pub fn push(&mut self, depth: i32)

Opens a nested box (push); depth is its nesting level (cur_s, 1 for a box inside the page box).

Source

pub fn note_depth(&mut self, depth: i32)

Records the nesting level of the page box itself (0).

Source

pub fn pop(&mut self)

Closes a nested box (dvi_pop, §601).

Source

pub fn glyph( &mut self, engine: &Engine, f: u32, chr: u32, h: i32, v: i32, width: i32, )

Typesets character chr of font f at (h, v) (§620); the reader then advances by width.

Source

pub fn rule(&mut self, h: i32, v: i32, width: i32, height: i32)

A rule of the given width and height with its lower left corner at (h, v); the reader then advances by width.

Source

pub fn special(&mut self, h: i32, v: i32, data: &[u8])

A \special at (h, v) (§1368).

Source

pub fn finish(&mut self, engine: &mut Engine) -> Vec<u8> ⓘ

Writes the postamble (§642) and returns the finished file.

Trait Implementations§

Source§

impl Debug for DviWriter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DviWriter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.