Skip to main content

Page

Struct Page 

Source
pub struct Page {
    pub number: u32,
    pub side: Side,
    pub width: f32,
    pub height: f32,
    pub bleed: f32,
    pub slug: f32,
    pub sections: Vec<NodeId>,
    pub items: Vec<DrawItem>,
    pub links: Vec<Link>,
}
Expand description

One typeset page: a number, a side, a trim size, and what to paint on it.

Coordinates are measured from the top left corner of the trim, so a page with a bleed has items at negative coordinates and past its width and height. The sheet a printer gets is the trim grown by bleed + slug on every edge.

Fields§

§number: u32

Folio, counting from 1.

§side: Side

Which side of the spread this page falls on.

§width: f32

Trimmed page width in points.

§height: f32

Trimmed page height in points.

§bleed: f32

How far past the trim the page background reaches, in points, on every edge. Art that runs to the edge of the finished page runs this far past it, so a cut that drifts still leaves no white edge. Zero on a page with no bleed.

§slug: f32

How far past the bleed the sheet reaches, in points, on every edge: the room crop marks and registration marks are painted in. Zero on a page with no marks.

§sections: Vec<NodeId>

The sections whose content appears on this page, in the order their content appears on it. A chapter that ends mid-page is followed there by the next one opening, so the page names both. A blank leaf names none.

§items: Vec<DrawItem>

What to paint, in paint order: by layer, and inside one layer in the order the blocks are written.

§links: Vec<Link>

The links set on this page, in the order their text is painted. Empty on a page with no link.

Implementations§

Source§

impl Page

Source

pub fn outset(&self) -> f32

How far the sheet reaches past the trim on every edge: the bleed and the slug together.

Trait Implementations§

Source§

impl Debug for Page

Source§

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

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

impl<'de> Deserialize<'de> for Page

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Page

Source§

fn eq(&self, other: &Page) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Page

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Page

Auto Trait Implementations§

§

impl Freeze for Page

§

impl RefUnwindSafe for Page

§

impl Send for Page

§

impl Sync for Page

§

impl Unpin for Page

§

impl UnsafeUnpin for Page

§

impl UnwindSafe for Page

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

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

§

impl<T> Finish for T

§

fn finish(self)

Does nothing but move self, equivalent to drop.
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.

§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

§

fn to_owned_table(&self) -> U

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.