Skip to main content

Paginator

Struct Paginator 

Source
pub struct Paginator<'a> { /* private fields */ }
Expand description

The pagination pass: content in, Pages of DrawItems out.

Fragments stack from the top of the content box. One that does not fit ends the page — at the last point a break was allowed, which may be several fragments back — and a fragment taller than a whole page overflows it.

Implementations§

Source§

impl Paginator<'_>

Source

pub fn section_fragments(&self, section: &Section) -> Vec<Fragment>

One section’s blocks as fragments, in document order: everything measurement decides, and nothing pagination does.

A block of the section that spans the columns breaks to the whole content box, and one that does not breaks to a column. A spanning block moves to the next page whole rather than split under the columns above it.

Source§

impl<'a> Paginator<'a>

Source

pub fn new(registry: &'a FontRegistry, styles: &'a StyleTree) -> Self

A paginator over one book’s styling and the faces it shapes with, for a book with no images in it.

Source

pub fn with_assets( registry: &'a FontRegistry, styles: &'a StyleTree, assets: &'a Assets, ) -> Self

The same, over images the host has already probed. A book whose sheet names a traced contour also passes what the trace stage made of it, through with_contours.

Source

pub fn with_contours( registry: &'a FontRegistry, styles: &'a StyleTree, assets: &'a Assets, contours: &'a Contours, ) -> Self

The same, over the contours the trace stage left.

Source§

impl Paginator<'_>

Source

pub fn language(&self, metadata: &Metadata)

Takes the hyphenation patterns from the language the book declares. paginate reads them from the book it is handed. A caller that builds one section’s fragments on its own sets them here.

A language with no patterns leaves every word whole, rather than breaking one language’s words at another’s syllables, and the first paragraph that asks for hyphenation says so.

Source

pub fn warnings(&self) -> Vec<Warning>

What fragmentation had to complain about.

Source

pub fn rebreaks(&self) -> u32

How many times the flow that paints set a paragraph again beside an image. A book that anchors nothing never does.

Source

pub fn settles(&self) -> u32

How many times the book was laid out a second time, to print the pages its references name. A book whose sheet prints no page number is laid out once.

Source

pub fn paginate(&self, book: &Book) -> Vec<Page>

Flows one book into numbered, side-tagged pages.

A section’s fragments are built, flowed, and released before the next one is measured: what exists at once is the book’s pages, not every line it was ever broken into.

A book whose references print pages is laid out twice: once to find the page each element lands on, and once to print it.

Source

pub fn flow(&self, book: &Book, sections: &[Vec<Fragment>]) -> Vec<Page>

Fragments in, numbered pages out: fragmentation and page assembly, one Vec<Fragment> per section of book. Nothing here measures — every fragment arrives with its box decided.

Auto Trait Implementations§

§

impl<'a> !Freeze for Paginator<'a>

§

impl<'a> !RefUnwindSafe for Paginator<'a>

§

impl<'a> !Sync for Paginator<'a>

§

impl<'a> Send for Paginator<'a>

§

impl<'a> Unpin for Paginator<'a>

§

impl<'a> UnsafeUnpin for Paginator<'a>

§

impl<'a> UnwindSafe for Paginator<'a>

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
§

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.