pub struct GlueSpec {
pub natural_subcell: u32,
pub stretch_subcell: u32,
pub shrink_subcell: u32,
}Expand description
TeX-style glue specification: natural width + stretch + shrink.
All values are in 1/256ths of a cell column (sub-cell units) to allow fine-grained control while remaining integer-only.
The optimizer computes an adjustment ratio r:
r > 0: stretch byr × stretch_subcellr < 0: shrink by|r| × shrink_subcellr = 0: use natural width
Fields§
§natural_subcell: u32Natural (ideal) width in sub-cell units (1/256 cell column).
stretch_subcell: u32Maximum stretchability in sub-cell units.
shrink_subcell: u32Maximum shrinkability in sub-cell units.
Implementations§
Source§impl GlueSpec
impl GlueSpec
Sourcepub const WORD_SPACE: Self
pub const WORD_SPACE: Self
A standard inter-word space: 1 cell, stretchable by 50%, shrinkable by 33%.
Sourcepub const SENTENCE_SPACE: Self
pub const SENTENCE_SPACE: Self
Inter-sentence space: 1.5 cells, more stretchable.
Sourcepub const FRENCH_SPACE: Self = Self::WORD_SPACE
pub const FRENCH_SPACE: Self = Self::WORD_SPACE
French spacing: same as word space (no extra after sentences).
Sourcepub const INTER_CHAR: Self
pub const INTER_CHAR: Self
Zero-width glue (for inter-character micro-adjustments).
Sourcepub fn adjusted_width(&self, ratio_fixed: i32) -> u32
pub fn adjusted_width(&self, ratio_fixed: i32) -> u32
Compute the effective width at a given adjustment ratio.
ratio is in 1/256ths: positive = stretch, negative = shrink.
Returns the adjusted width in sub-cell units, clamped to
[natural - shrink, natural + stretch].
Sourcepub const fn elasticity(&self) -> u32
pub const fn elasticity(&self) -> u32
Total elasticity (stretch + shrink) in sub-cell units.
Trait Implementations§
impl Copy for GlueSpec
impl Eq for GlueSpec
impl StructuralPartialEq for GlueSpec
Auto Trait Implementations§
impl Freeze for GlueSpec
impl RefUnwindSafe for GlueSpec
impl Send for GlueSpec
impl Sync for GlueSpec
impl Unpin for GlueSpec
impl UnsafeUnpin for GlueSpec
impl UnwindSafe for GlueSpec
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.