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<'_>
impl Paginator<'_>
Sourcepub fn section_fragments(&self, section: &Section) -> Vec<Fragment>
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>
impl<'a> Paginator<'a>
Sourcepub fn new(registry: &'a FontRegistry, styles: &'a StyleTree) -> Self
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.
Sourcepub fn with_assets(
registry: &'a FontRegistry,
styles: &'a StyleTree,
assets: &'a Assets,
) -> Self
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.
Sourcepub fn with_contours(
registry: &'a FontRegistry,
styles: &'a StyleTree,
assets: &'a Assets,
contours: &'a Contours,
) -> Self
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<'_>
impl Paginator<'_>
Sourcepub fn language(&self, metadata: &Metadata)
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.
Sourcepub fn rebreaks(&self) -> u32
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.
Sourcepub fn settles(&self) -> u32
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.
Sourcepub fn paginate(&self, book: &Book) -> Vec<Page>
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.
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.