pub struct FontInfo { /* private fields */ }Expand description
Representation of a single font in a family.
Implementations§
Source§impl FontInfo
impl FontInfo
Sourcepub fn from_source(source: SourceInfo, index: u32) -> Option<Self>
pub fn from_source(source: SourceInfo, index: u32) -> Option<Self>
Creates a new font object from the given source and index.
Sourcepub fn source(&self) -> &SourceInfo
pub fn source(&self) -> &SourceInfo
Returns an object describing how to locate the data containing this font.
Sourcepub fn load(&self, source_cache: Option<&mut SourceCache>) -> Option<Blob<u8>>
pub fn load(&self, source_cache: Option<&mut SourceCache>) -> Option<Blob<u8>>
Attempts to load the font, optionally from a source cache.
Sourcepub fn width(&self) -> FontWidth
pub fn width(&self) -> FontWidth
Returns the visual width of the font– a relative change from the normal
aspect ratio, typically in the range 0.5 to 2.0.
Sourcepub fn weight(&self) -> FontWeight
pub fn weight(&self) -> FontWeight
Returns the visual weight class of the font, typically on a scale
from 1.0 to 1000.0.
Sourcepub fn synthesis(
&self,
width: FontWidth,
style: FontStyle,
weight: FontWeight,
) -> Synthesis
pub fn synthesis( &self, width: FontWidth, style: FontStyle, weight: FontWeight, ) -> Synthesis
Returns synthesis suggestions for this font with the given attributes.
Sourcepub fn has_weight_axis(&self) -> bool
pub fn has_weight_axis(&self) -> bool
Sourcepub fn has_width_axis(&self) -> bool
pub fn has_width_axis(&self) -> bool
Sourcepub fn has_slant_axis(&self) -> bool
pub fn has_slant_axis(&self) -> bool
Sourcepub fn has_italic_axis(&self) -> bool
pub fn has_italic_axis(&self) -> bool
Sourcepub fn has_optical_size_axis(&self) -> bool
pub fn has_optical_size_axis(&self) -> bool
Sourcepub fn charmap_index(&self) -> CharmapIndex
pub fn charmap_index(&self) -> CharmapIndex
Returns the index used for constructing a Charmap for this font.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FontInfo
impl !RefUnwindSafe for FontInfo
impl Send for FontInfo
impl Sync for FontInfo
impl Unpin for FontInfo
impl !UnwindSafe for FontInfo
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