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

source

pub fn distribute_across_threads() -> bool

source

pub fn new() -> FontContext

source

pub fn add_raw_font( &mut self, font_key: &FontKey, bytes: Arc<Vec<u8>>, index: u32, )

source

pub fn add_native_font( &mut self, font_key: &FontKey, native_font_handle: NativeFontHandle, )

source

pub fn delete_font(&mut self, font_key: &FontKey)

source

pub fn delete_font_instance(&mut self, _instance: &FontInstance)

source

fn load_glyph( &mut self, font: &FontInstance, glyph: &GlyphKey, ) -> Option<(MutexGuard<'_, CachedFont>, FT_GlyphSlot, f32)>

source

fn pad_bounding_box(font: &FontInstance, cbox: &mut FT_BBox)

source

fn get_bounding_box( slot: FT_GlyphSlot, font: &FontInstance, glyph: &GlyphKey, scale: f32, ) -> FT_BBox

source

fn get_glyph_dimensions_impl( slot: FT_GlyphSlot, font: &FontInstance, glyph: &GlyphKey, scale: f32, use_transform: bool, ) -> Option<GlyphDimensions>

source

pub fn get_glyph_index(&mut self, font_key: FontKey, ch: char) -> Option<u32>

source

pub fn get_glyph_dimensions( &mut self, font: &FontInstance, key: &GlyphKey, ) -> Option<GlyphDimensions>

source

fn choose_bitmap_size(&self, face: FT_Face, requested_size: f64) -> FT_Error

source

pub fn prepare_font(font: &mut FontInstance)

source

fn rasterize_glyph_outline( slot: FT_GlyphSlot, font: &FontInstance, key: &GlyphKey, scale: f32, ) -> bool

source

pub fn begin_rasterize(font: &FontInstance)

source

pub fn end_rasterize(font: &FontInstance)

source

pub fn rasterize_glyph( &mut self, font: &FontInstance, key: &GlyphKey, ) -> GlyphRasterResult

Trait Implementations§

source§

impl AddFont for FontContext

source§

fn add_font(&mut self, font_key: &FontKey, template: &FontTemplate)

source§

impl AsyncForEach<FontContext> for Arc<FontContexts>

source§

fn async_for_each<F: Fn(MutexGuard<'_, FontContext>) + Send + 'static>( &self, f: F, )

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.