pub struct PlatformFont {
face: ReentrantMutex<FT_Face>,
requested_face_size: Au,
actual_face_size: Au,
}
Fields§
§face: ReentrantMutex<FT_Face>
§requested_face_size: Au
§actual_face_size: Au
Implementations§
source§impl PlatformFont
impl PlatformFont
sourcefn unscalable_font_metrics_scale(&self) -> f64
fn unscalable_font_metrics_scale(&self) -> f64
Find the scale to use for metrics of unscalable fonts. Unscalable fonts, those using bitmap glyphs, are scaled after glyph rasterization. In order for metrics to match the final scaled font, we need to scale them based on the final size and the actual font size.
Trait Implementations§
source§impl Debug for PlatformFont
impl Debug for PlatformFont
source§impl Drop for PlatformFont
impl Drop for PlatformFont
source§impl PlatformFontMethods for PlatformFont
impl PlatformFontMethods for PlatformFont
fn new_from_data( _font_identifier: FontIdentifier, font_data: &FontData, requested_size: Option<Au>, ) -> Result<PlatformFont, &'static str>
fn new_from_local_font_identifier( font_identifier: LocalFontIdentifier, requested_size: Option<Au>, ) -> Result<PlatformFont, &'static str>
source§fn descriptor(&self) -> FontTemplateDescriptor
fn descriptor(&self) -> FontTemplateDescriptor
Get a
FontTemplateDescriptor
from a PlatformFont
. This is used to get
descriptors for web fonts.fn glyph_index(&self, codepoint: char) -> Option<GlyphId>
fn glyph_h_kerning( &self, first_glyph: GlyphId, second_glyph: GlyphId, ) -> FractionalPixel
fn glyph_h_advance(&self, glyph: GlyphId) -> Option<FractionalPixel>
fn metrics(&self) -> FontMetrics
fn table_for_tag(&self, tag: FontTableTag) -> Option<FontTable>
fn typographic_bounds(&self, glyph_id: GlyphId) -> Rect<f32>
source§fn webrender_font_instance_flags(&self) -> FontInstanceFlags
fn webrender_font_instance_flags(&self) -> FontInstanceFlags
Get the necessary
FontInstanceFlags
` for this font.fn new_from_template( template: FontTemplateRef, pt_size: Option<Au>, data: &Option<FontData>, ) -> Result<PlatformFont, &'static str>
impl Send for PlatformFont
impl Sync for PlatformFont
Auto Trait Implementations§
impl !Freeze for PlatformFont
impl !RefUnwindSafe for PlatformFont
impl Unpin for PlatformFont
impl UnwindSafe for PlatformFont
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> 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>
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert