Struct wr_glyph_rasterizer::platform::unix::font::FontContext
source · pub struct FontContext {
fonts: FastHashMap<FontKey, Arc<Mutex<CachedFont>>>,
}
Fields§
§fonts: FastHashMap<FontKey, Arc<Mutex<CachedFont>>>
Implementations§
source§impl FontContext
impl FontContext
pub fn distribute_across_threads() -> bool
pub fn new() -> FontContext
pub fn add_raw_font( &mut self, font_key: &FontKey, bytes: Arc<Vec<u8>>, index: u32, )
pub fn add_native_font( &mut self, font_key: &FontKey, native_font_handle: NativeFontHandle, )
pub fn delete_font(&mut self, font_key: &FontKey)
pub fn delete_font_instance(&mut self, _instance: &FontInstance)
fn load_glyph( &mut self, font: &FontInstance, glyph: &GlyphKey, ) -> Option<(MutexGuard<'_, CachedFont>, FT_GlyphSlot, f32)>
fn pad_bounding_box(font: &FontInstance, cbox: &mut FT_BBox)
fn get_bounding_box( slot: FT_GlyphSlot, font: &FontInstance, glyph: &GlyphKey, scale: f32, ) -> FT_BBox
fn get_glyph_dimensions_impl( slot: FT_GlyphSlot, font: &FontInstance, glyph: &GlyphKey, scale: f32, use_transform: bool, ) -> Option<GlyphDimensions>
pub fn get_glyph_index(&mut self, font_key: FontKey, ch: char) -> Option<u32>
pub fn get_glyph_dimensions( &mut self, font: &FontInstance, key: &GlyphKey, ) -> Option<GlyphDimensions>
fn choose_bitmap_size(&self, face: FT_Face, requested_size: f64) -> FT_Error
pub fn prepare_font(font: &mut FontInstance)
fn rasterize_glyph_outline( slot: FT_GlyphSlot, font: &FontInstance, key: &GlyphKey, scale: f32, ) -> bool
pub fn begin_rasterize(font: &FontInstance)
pub fn end_rasterize(font: &FontInstance)
pub fn rasterize_glyph( &mut self, font: &FontInstance, key: &GlyphKey, ) -> GlyphRasterResult
Trait Implementations§
source§impl AddFont for FontContext
impl AddFont for FontContext
fn add_font(&mut self, font_key: &FontKey, template: &FontTemplate)
source§impl AsyncForEach<FontContext> for Arc<FontContexts>
impl AsyncForEach<FontContext> for Arc<FontContexts>
fn async_for_each<F: Fn(MutexGuard<'_, FontContext>) + Send + 'static>( &self, f: F, )
Auto Trait Implementations§
impl Freeze for FontContext
impl RefUnwindSafe for FontContext
impl Send for FontContext
impl Sync for FontContext
impl Unpin for FontContext
impl UnwindSafe for FontContext
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> 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 more