pub struct FontFace(/* private fields */);
Expand description
Implementations§
source§impl FontFace
impl FontFace
sourcepub fn bytes(&self) -> &FontDataRef
pub fn bytes(&self) -> &FontDataRef
Reference the font file bytes.
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 Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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.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