pub struct Font<'a> { /* private fields */ }Implementations§
Source§impl<'a> Font<'a>
impl<'a> Font<'a>
pub fn texture(&self) -> &Texture
Sourcepub fn get_glyphs(
&mut self,
text: &str,
settings: TextSettings,
) -> Result<Vec<CharacterPosition>, FontError>
pub fn get_glyphs( &mut self, text: &str, settings: TextSettings, ) -> Result<Vec<CharacterPosition>, FontError>
Returns a sequence of the position of each character in the string on the cache.
Trait Implementations§
Source§impl<'a> Loadable for Font<'a>
impl<'a> Loadable for Font<'a>
Source§type LoadOptions = ()
type LoadOptions = ()
Type of an additional argument that can be supplied to the
load methods. Read moreSource§fn load_from_bytes(data: &[u8], _options: ()) -> Result<Self, FontError>
fn load_from_bytes(data: &[u8], _options: ()) -> Result<Self, FontError>
Loads the object from a byte sequence.
Source§fn load_from_file<P: AsRef<OsStr>>(
path: P,
options: Self::LoadOptions,
) -> Result<Self, Self::LoadError>
fn load_from_file<P: AsRef<OsStr>>( path: P, options: Self::LoadOptions, ) -> Result<Self, Self::LoadError>
Loads the object from a file. Read more
Auto Trait Implementations§
impl<'a> Freeze for Font<'a>
impl<'a> RefUnwindSafe for Font<'a>
impl<'a> Send for Font<'a>
impl<'a> Sync for Font<'a>
impl<'a> Unpin for Font<'a>
impl<'a> UnwindSafe for Font<'a>
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
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>
Converts
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>
Converts
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