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: f32Bin 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: f32Body size (in points) assumed when the document has no text at all.
body_size_tolerance_pt: f32Largest difference (in points) between a line’s size and the body size for the line to count as running text.
leading_min_glyphs_count: usizeLines 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: usizeHow many following body lines are inspected when looking for the next line below a given one.
leading_max_gap_em: f32A 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: f32A 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: f32Minimum 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: f32Bin width (in points) of the histogram of line pitches.
default_leading_em: f32Leading (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: f32Two 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: f32The 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: f32Width (in leadings) of the window in which spaced distances count as the same.
Trait Implementations§
Source§impl Clone for PageConfig
impl Clone for PageConfig
impl Copy for PageConfig
Source§impl Debug for PageConfig
impl Debug for PageConfig
Source§impl Default for PageConfig
impl Default for PageConfig
Source§impl PartialEq for PageConfig
impl PartialEq for PageConfig
impl StructuralPartialEq for PageConfig
Auto Trait Implementations§
impl Forget for PageConfig
impl Freeze for PageConfig
impl Move for PageConfig
impl RefUnwindSafe for PageConfig
impl Send for PageConfig
impl Sync for PageConfig
impl Unpin for PageConfig
impl UnsafeUnpin for PageConfig
impl UnwindSafe for PageConfig
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§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.