Skip to main content

PageConfig

Struct PageConfig 

Source
pub struct PageConfig {
Show 15 fields pub body_size_bin_pt: f32, pub default_body_size_pt: f32, pub body_size_tolerance_pt: f32, pub leading_min_glyphs_count: usize, pub leading_lookahead_count: usize, pub leading_max_gap_em: f32, pub leading_min_gap_em: f32, pub leading_overlap_ratio: f32, pub leading_bin_pt: f32, pub default_leading_em: f32, pub line_pitch_max_leading: f32, pub para_space_min_leading: f32, pub spaced_paragraphs_min_ratio: f32, pub para_space_regular_min_ratio: f32, pub para_space_tolerance_leading: f32,
}
Expand description

Tuning parameters of the document-wide page statistics. Part of LayoutConfig.

Fields§

§body_size_bin_pt: f32

Bin width (in points) of the font-size histogram whose mode is the body size. A quarter point merges sizes that differ only by rounding in the PDF while keeping 9 pt and 10 pt apart.

§default_body_size_pt: f32

Body size (in points) assumed when the document has no text at all.

§body_size_tolerance_pt: f32

Largest difference (in points) between a line’s size and the body size for the line to count as running text.

§leading_min_glyphs_count: usize

Lines with at most this many glyphs are ignored when measuring the leading: short lines (headings, equation numbers, labels) are often not part of a regular paragraph.

§leading_lookahead_count: usize

How many following body lines are inspected when looking for the next line below a given one.

§leading_max_gap_em: f32

A vertical distance above this (in body sizes) ends the search for the line below: anything further away is a paragraph or section gap, not the line pitch.

§leading_min_gap_em: f32

A vertical distance must exceed this (in body sizes) to count as a line pitch; smaller distances are lines of a neighbouring column or fragments on (nearly) the same baseline.

§leading_overlap_ratio: f32

Minimum horizontal overlap of two lines, as a fraction of the narrower one, for them to count as vertically adjacent lines of the same column.

§leading_bin_pt: f32

Bin width (in points) of the histogram of line pitches.

§default_leading_em: f32

Leading (in body sizes) assumed when no pair of adjacent body lines was found; 1.2 is the usual default line spacing of typesetters.

§line_pitch_max_leading: f32

Two adjacent body lines are lines of one paragraph when their baseline distance is at most this many leadings …

§para_space_min_leading: f32

… and lines of two paragraphs set apart by a blank space when it is at least this many leadings (and at most PageConfig::leading_max_gap_em).

§spaced_paragraphs_min_ratio: f32

The document separates its paragraphs by space (a novel made in Word, with no first-line indent) when at least this share of the adjacent body lines are spaced paragraphs …

§para_space_regular_min_ratio: f32

… and at least this share of those spaced distances are the same (within PageConfig::para_space_tolerance_leading): a blank line or a fixed space after each paragraph, not the varied gaps around the headings, equations and figures of a paper.

§para_space_tolerance_leading: f32

Width (in leadings) of the window in which spaced distances count as the same.

Trait Implementations§

Source§

impl Clone for PageConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PageConfig

Source§

impl Debug for PageConfig

Source§

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

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

impl Default for PageConfig

Source§

fn default() -> Self

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

impl PartialEq for PageConfig

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PageConfig

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<T> Finish for T

Source§

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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

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

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

Source§

fn to_owned_table(&self) -> U

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V