pub struct TextLinePrefixWidths { /* private fields */ }Expand description
The width of every prefix of one line of text. It answers how wide any range of characters is without measuring again.
Implementations§
Source§impl TextLinePrefixWidths
impl TextLinePrefixWidths
Sourcepub fn from_parts(
prefix_widths: Vec<f32>,
separator_before: Vec<f32>,
non_empty_overhang: f32,
) -> Option<Self>
pub fn from_parts( prefix_widths: Vec<f32>, separator_before: Vec<f32>, non_empty_overhang: f32, ) -> Option<Self>
Builds the table. prefix_widths holds the width of the first 0, 1, 2 and so on
characters, so one more value than the line has characters. separator_before holds one
value for each character: the part of the width before it that is dropped when a range
starts at that character. A range of at least one character also gains
non_empty_overhang, and a negative overhang counts as 0.0. Returns None when the
lengths do not match or a value is not finite.
Sourcepub fn monospaced(
char_count: usize,
char_width: f32,
letter_spacing: f32,
) -> Option<Self>
pub fn monospaced( char_count: usize, char_width: f32, letter_spacing: f32, ) -> Option<Self>
Builds a table for char_count characters of width char_width that each add
letter_spacing. Negative values count as 0.0. Returns None when a value is not
finite.
Sourcepub fn char_count(&self) -> usize
pub fn char_count(&self) -> usize
Number of characters the table covers.
Trait Implementations§
Source§impl Clone for TextLinePrefixWidths
impl Clone for TextLinePrefixWidths
Source§impl Debug for TextLinePrefixWidths
impl Debug for TextLinePrefixWidths
Source§impl PartialEq for TextLinePrefixWidths
impl PartialEq for TextLinePrefixWidths
impl StructuralPartialEq for TextLinePrefixWidths
Auto Trait Implementations§
impl Freeze for TextLinePrefixWidths
impl RefUnwindSafe for TextLinePrefixWidths
impl Send for TextLinePrefixWidths
impl Sync for TextLinePrefixWidths
impl Unpin for TextLinePrefixWidths
impl UnsafeUnpin for TextLinePrefixWidths
impl UnwindSafe for TextLinePrefixWidths
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,
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 more