[−][src]Struct fit_text::BasicGlyphs
A basic implementor for CharacterWidthCache
Methods
impl<'f> BasicGlyphs<'f>
[src]
pub fn from_bytes(bytes: &'f [u8]) -> Result<BasicGlyphs<'f>, Error>
[src]
Loads a Glyphs
from an array of font data.
pub fn from_font(font: Font<'f>) -> BasicGlyphs<'f>
[src]
Loads a Glyphs
from a Font
.
Trait Implementations
impl<'f> CharacterWidthCache for BasicGlyphs<'f>
[src]
fn char_width(&mut self, character: char, font_size: u32) -> f64
[src]
fn width(&mut self, text: &str, font_size: u32) -> f64
[src]
fn format_lines<S, F>(
&mut self,
text: S,
max_width: f64,
format: F
) -> Vec<String> where
S: AsRef<str>,
F: Into<TextFormat>,
[src]
&mut self,
text: S,
max_width: f64,
format: F
) -> Vec<String> where
S: AsRef<str>,
F: Into<TextFormat>,
fn max_line_width<S, F>(&mut self, text: S, max_width: f64, format: F) -> f64 where
S: AsRef<str>,
F: Into<TextFormat>,
[src]
S: AsRef<str>,
F: Into<TextFormat>,
fn justify_text<S, R, F>(
&mut self,
text: S,
rect: R,
format: F
) -> PositionedLines<R::Vector> where
S: AsRef<str>,
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
&mut self,
text: S,
rect: R,
format: F
) -> PositionedLines<R::Vector> where
S: AsRef<str>,
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn justify_meta_fragments<I, M, S, R, F>(
&mut self,
fragments: I,
rect: R,
format: F
) -> PositionedLinesMeta<R::Vector, M> where
I: IntoIterator<Item = (S, M)>,
M: Clone,
S: AsRef<str>,
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
&mut self,
fragments: I,
rect: R,
format: F
) -> PositionedLinesMeta<R::Vector, M> where
I: IntoIterator<Item = (S, M)>,
M: Clone,
S: AsRef<str>,
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn text_fits_horizontal<R, F>(&mut self, text: &str, rect: R, format: F) -> bool where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn text_fits_vertical<R, F>(&mut self, text: &str, rect: R, format: F) -> bool where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn text_fits<R, F>(&mut self, text: &str, rect: R, format: F) -> bool where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn fit_max_font_size<R, F>(&mut self, text: &str, rect: R, format: F) -> u32 where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn fit_min_height<R, F>(
&mut self,
text: &str,
rect: R,
format: F,
delta: f64
) -> f64 where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
&mut self,
text: &str,
rect: R,
format: F,
delta: f64
) -> f64 where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn fit_min_width<R, F>(
&mut self,
text: &str,
rect: R,
format: F,
delta: f64
) -> f64 where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
&mut self,
text: &str,
rect: R,
format: F,
delta: f64
) -> f64 where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn ideal_text_size<R, F>(
&mut self,
text: &str,
rect: R,
format: F
) -> TextFormat where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
&mut self,
text: &str,
rect: R,
format: F
) -> TextFormat where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
impl<'f> Clone for BasicGlyphs<'f>
[src]
fn clone(&self) -> BasicGlyphs<'f>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<'f> Sync for BasicGlyphs<'f>
impl<'f> Unpin for BasicGlyphs<'f>
impl<'f> Send for BasicGlyphs<'f>
impl<'f> UnwindSafe for BasicGlyphs<'f>
impl<'f> RefUnwindSafe for BasicGlyphs<'f>
Blanket Implementations
impl<C> CharacterWidthCache for C where
C: CharacterCache,
[src]
C: CharacterCache,
fn char_width(&mut Self, char, u32) -> f64
[src]
fn width(&mut self, text: &str, font_size: u32) -> f64
[src]
fn format_lines<S, F>(
&mut self,
text: S,
max_width: f64,
format: F
) -> Vec<String> where
S: AsRef<str>,
F: Into<TextFormat>,
[src]
&mut self,
text: S,
max_width: f64,
format: F
) -> Vec<String> where
S: AsRef<str>,
F: Into<TextFormat>,
fn max_line_width<S, F>(&mut self, text: S, max_width: f64, format: F) -> f64 where
S: AsRef<str>,
F: Into<TextFormat>,
[src]
S: AsRef<str>,
F: Into<TextFormat>,
fn justify_text<S, R, F>(
&mut self,
text: S,
rect: R,
format: F
) -> PositionedLines<R::Vector> where
S: AsRef<str>,
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
&mut self,
text: S,
rect: R,
format: F
) -> PositionedLines<R::Vector> where
S: AsRef<str>,
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn justify_meta_fragments<I, M, S, R, F>(
&mut self,
fragments: I,
rect: R,
format: F
) -> PositionedLinesMeta<R::Vector, M> where
I: IntoIterator<Item = (S, M)>,
M: Clone,
S: AsRef<str>,
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
&mut self,
fragments: I,
rect: R,
format: F
) -> PositionedLinesMeta<R::Vector, M> where
I: IntoIterator<Item = (S, M)>,
M: Clone,
S: AsRef<str>,
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn text_fits_horizontal<R, F>(&mut self, text: &str, rect: R, format: F) -> bool where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn text_fits_vertical<R, F>(&mut self, text: &str, rect: R, format: F) -> bool where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn text_fits<R, F>(&mut self, text: &str, rect: R, format: F) -> bool where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn fit_max_font_size<R, F>(&mut self, text: &str, rect: R, format: F) -> u32 where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn fit_min_height<R, F>(
&mut self,
text: &str,
rect: R,
format: F,
delta: f64
) -> f64 where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
&mut self,
text: &str,
rect: R,
format: F,
delta: f64
) -> f64 where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn fit_min_width<R, F>(
&mut self,
text: &str,
rect: R,
format: F,
delta: f64
) -> f64 where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
&mut self,
text: &str,
rect: R,
format: F,
delta: f64
) -> f64 where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
fn ideal_text_size<R, F>(
&mut self,
text: &str,
rect: R,
format: F
) -> TextFormat where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
[src]
&mut self,
text: &str,
rect: R,
format: F
) -> TextFormat where
R: Rectangle<Scalar = f64>,
F: Into<TextFormat>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,