pub struct PageGeometry {
pub width: f32,
pub height: f32,
pub margin: Edges,
pub columns: Columns,
pub align_content: AlignContent,
}Expand description
Page trim, margins and columns, in points: the resolved @page
box.
Fields§
§width: f32Trimmed page width.
height: f32Trimmed page height.
margin: EdgesMargins, resolved from the page’s own margin. Mirroring
across the spread is @page :left and @page :right saying
different things, not a property of its own.
columns: ColumnsHow the content box divides.
align_content: AlignContentWhere the content of a page that ends short of the foot of its content box sits.
Implementations§
Source§impl PageGeometry
impl PageGeometry
Sourcepub fn content_origin(self) -> (f32, f32)
pub fn content_origin(self) -> (f32, f32)
Origin (top-left) of the content box, in page coordinates.
Sourcepub fn content_size(self) -> (f32, f32)
pub fn content_size(self) -> (f32, f32)
Size of the content box.
Sourcepub fn column_count(self) -> u32
pub fn column_count(self) -> u32
How many columns the content box divides into.
A declared column-width is a preference: as many columns of
that width as fit, and where column-count was declared too
it is the ceiling on that. A box too narrow for one column of
that width still divides into one.
Sourcepub fn measure(self) -> f32
pub fn measure(self) -> f32
The measure line layout breaks to: one column’s width, which on an undivided page is the content box’s own.
Sourcepub fn column_origin(self, index: u32) -> (f32, f32)
pub fn column_origin(self, index: u32) -> (f32, f32)
Origin (top-left) of one column, in page coordinates.
Trait Implementations§
Source§impl Clone for PageGeometry
impl Clone for PageGeometry
Source§fn clone(&self) -> PageGeometry
fn clone(&self) -> PageGeometry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PageGeometry
Source§impl Debug for PageGeometry
impl Debug for PageGeometry
Source§impl PartialEq for PageGeometry
impl PartialEq for PageGeometry
Source§impl Serialize for PageGeometry
impl Serialize for PageGeometry
impl StructuralPartialEq for PageGeometry
Auto Trait Implementations§
impl Freeze for PageGeometry
impl RefUnwindSafe for PageGeometry
impl Send for PageGeometry
impl Sync for PageGeometry
impl Unpin for PageGeometry
impl UnsafeUnpin for PageGeometry
impl UnwindSafe for PageGeometry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.