pub struct FontFace(/* private fields */);Expand description
Implementations§
Source§impl FontFace
impl FontFace
Sourcepub fn display_name(&self) -> &FontName
pub fn display_name(&self) -> &FontName
Font full name.
Sourcepub fn family_name(&self) -> &FontName
pub fn family_name(&self) -> &FontName
Font family name.
Sourcepub fn postscript_name(&self) -> Option<&str>
pub fn postscript_name(&self) -> Option<&str>
Font globally unique name.
Sourcepub fn weight(&self) -> FontWeight
pub fn weight(&self) -> FontWeight
Font weight.
Sourcepub fn stretch(&self) -> FontStretch
pub fn stretch(&self) -> FontStretch
Font stretch.
Sourcepub fn is_monospace(&self) -> bool
pub fn is_monospace(&self) -> bool
Font is monospace (fixed-width).
Sourcepub fn metrics(&self) -> &FontFaceMetrics
pub fn metrics(&self) -> &FontFaceMetrics
Font metrics in font units.
Sourcepub fn sized(&self, font_size: Px, variations: Vec<Variation>) -> Font
pub fn sized(&self, font_size: Px, variations: Vec<Variation>) -> Font
Gets a cached sized Font.
The font_size is the size of 1 font EM in pixels.
The variations are custom font variations that will be used
during shaping and rendering.
Sourcepub fn synthesis_for(
&self,
style: FontStyle,
weight: FontWeight,
) -> FontSynthesis
pub fn synthesis_for( &self, style: FontStyle, weight: FontWeight, ) -> FontSynthesis
Gets what font synthesis to use to better render this font face given the style and weight.
Sourcepub fn is_cached(&self) -> bool
pub fn is_cached(&self) -> bool
If this font face is cached. All font faces are cached by default, a font face can be detached from
cache when a FONT_CHANGED_EVENT event happens, in this case the font can still be used normally, but
a request for the same font name will return a different reference.
Sourcepub fn color_palettes(&self) -> ColorPalettes<'_>
pub fn color_palettes(&self) -> ColorPalettes<'_>
CPAL table.
Is empty if not provided by the font.
Sourcepub fn color_glyphs(&self) -> ColorGlyphs<'_>
pub fn color_glyphs(&self) -> ColorGlyphs<'_>
COLR table.
Is empty if not provided by the font.
Sourcepub fn has_ligatures(&self) -> bool
pub fn has_ligatures(&self) -> bool
If the font provides glyph substitutions.
Sourcepub fn has_ligature_caret_offsets(&self) -> bool
pub fn has_ligature_caret_offsets(&self) -> bool
If this font provides custom positioned carets for some or all ligature glyphs.
If true the Font::ligature_caret_offsets method can be used to get the caret offsets, otherwise
it always returns empty.
Sourcepub fn has_raster_images(&self) -> bool
pub fn has_raster_images(&self) -> bool
If this font has bitmap images associated with some glyphs.
Sourcepub fn has_svg_images(&self) -> bool
pub fn has_svg_images(&self) -> bool
If this font has SVG images associated with some glyphs.
Trait Implementations§
impl Eq for FontFace
Auto Trait Implementations§
impl Freeze for FontFace
impl !RefUnwindSafe for FontFace
impl Send for FontFace
impl Sync for FontFace
impl Unpin for FontFace
impl !UnwindSafe for FontFace
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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