Struct fonts::platform::freetype::library_handle::FreeTypeLibraryHandle
source · pub(crate) struct FreeTypeLibraryHandle {
pub freetype_library: FT_Library,
freetype_memory: FT_Memory,
}
Expand description
A FreeType library handle to be used for creating and dropping FreeType font faces. It is very important that this handle lives as long as the faces themselves, which is why only one of these is created for the entire execution of Servo and never dropped during execution.
Fields§
§freetype_library: FT_Library
§freetype_memory: FT_Memory
Implementations§
source§impl FreeTypeLibraryHandle
impl FreeTypeLibraryHandle
sourcepub(crate) fn get() -> &'static Mutex<FreeTypeLibraryHandle>
pub(crate) fn get() -> &'static Mutex<FreeTypeLibraryHandle>
Get the shared FreeType library handle. This is protected by a mutex because according to the FreeType documentation:
[Since 2.5.6] In multi-threaded applications it is easiest to use one FT_Library object per thread. In case this is too cumbersome, a single FT_Library object across threads is possible also, as long as a mutex lock is used around FT_New_Face and FT_Done_Face.
See https://freetype.org/freetype2/docs/reference/ft2-library_setup.html.
Trait Implementations§
source§impl Clone for FreeTypeLibraryHandle
impl Clone for FreeTypeLibraryHandle
source§fn clone(&self) -> FreeTypeLibraryHandle
fn clone(&self) -> FreeTypeLibraryHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FreeTypeLibraryHandle
impl Debug for FreeTypeLibraryHandle
source§impl Drop for FreeTypeLibraryHandle
impl Drop for FreeTypeLibraryHandle
source§impl MallocSizeOf for FreeTypeLibraryHandle
impl MallocSizeOf for FreeTypeLibraryHandle
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
impl Send for FreeTypeLibraryHandle
impl Sync for FreeTypeLibraryHandle
Auto Trait Implementations§
impl Freeze for FreeTypeLibraryHandle
impl RefUnwindSafe for FreeTypeLibraryHandle
impl Unpin for FreeTypeLibraryHandle
impl UnwindSafe for FreeTypeLibraryHandle
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> 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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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