pub struct FontSizeFit {
pub min: f32,
pub max: Option<f32>,
}Expand description
The font sizes a text is fitted between, as fractions of the canvas’s shorter side.
The text draws at the largest size in [min, max] at which no line breaks inside a word,
the lines fit the box’s height, and there are no more lines than line_clamp.max_lines.
When no size fits, it draws at min. A min above max wins, as CSS min-width does.
Sizes are tried by bisection over max, min and the multiples of 1 / 8192 between.
Fields§
§min: f32Smallest font size, positive. At most the holder’s largest font size.
max: Option<f32>Largest font size, at least min and at most the holder’s largest font size. None
is font_size, so the text only shrinks.
Trait Implementations§
Source§impl Clone for FontSizeFit
impl Clone for FontSizeFit
impl Copy for FontSizeFit
Source§impl Debug for FontSizeFit
impl Debug for FontSizeFit
Source§impl<'de> Deserialize<'de> for FontSizeFit
impl<'de> Deserialize<'de> for FontSizeFit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FontSizeFit
impl PartialEq for FontSizeFit
Source§impl Serialize for FontSizeFit
impl Serialize for FontSizeFit
impl StructuralPartialEq for FontSizeFit
Auto Trait Implementations§
impl Forget for FontSizeFit
impl Freeze for FontSizeFit
impl Move for FontSizeFit
impl RefUnwindSafe for FontSizeFit
impl Send for FontSizeFit
impl Sync for FontSizeFit
impl Unpin for FontSizeFit
impl UnsafeUnpin for FontSizeFit
impl UnwindSafe for FontSizeFit
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
Mutably borrows from an owned value. Read more