Trait font_info::FontInfoLoader
source · pub trait FontInfoLoader {
// Required method
fn load_font_info<S, E>(
&self,
source: S,
index: u32
) -> Result<FontInfo, Error>
where S: TryInto<FontAssetSource, Error = E>,
E: Sync + Send + Into<Error>;
}
Expand description
An object that can load a FontInfo
from a FontAssetSource
.
Separate from the implementation to allow easier mocking for tests.
Required Methods§
sourcefn load_font_info<S, E>(&self, source: S, index: u32) -> Result<FontInfo, Error>
fn load_font_info<S, E>(&self, source: S, index: u32) -> Result<FontInfo, Error>
Load information about a font from the given file source, located at the given index within the file.
S
is any type for which a conversion is defined into FT_Open_Args
. In practice,
this must be either a something that contains an FT_Stream
, or a file path.
For simplicity, use [crates::sources::FontAssetSource].
Object Safety§
This trait is not object safe.