Struct fonts::system_font_service::SystemFontService
source · pub struct SystemFontService {
port: IpcReceiver<SystemFontServiceMessage>,
local_families: FontStore,
compositor_api: CrossProcessCompositorApi,
webrender_fonts: HashMap<FontIdentifier, FontKey>,
font_instances: HashMap<(FontKey, Au), FontInstanceKey>,
generic_fonts: ResolvedGenericFontFamilies,
free_font_keys: Vec<FontKey>,
free_font_instance_keys: Vec<FontInstanceKey>,
}
Expand description
The system font service. There is one of these for every Servo instance. This is a thread, responsible for reading the list of system fonts, handling requests to match against them, and ensuring that only one copy of system font data is loaded at a time.
Fields§
§port: IpcReceiver<SystemFontServiceMessage>
§local_families: FontStore
§compositor_api: CrossProcessCompositorApi
§webrender_fonts: HashMap<FontIdentifier, FontKey>
§font_instances: HashMap<(FontKey, Au), FontInstanceKey>
§generic_fonts: ResolvedGenericFontFamilies
§free_font_keys: Vec<FontKey>
This is an optimization that allows the SystemFontService
to send font data to
the compositor asynchronously for creating WebRender fonts, while immediately
returning a font key for that data. Once the free keys are exhausted, the
SystemFontService
will fetch a new batch.
free_font_instance_keys: Vec<FontInstanceKey>
This is an optimization that allows the SystemFontService
to create WebRender font
instances in the compositor asynchronously, while immediately returning a font
instance key for the instance. Once the free keys are exhausted, the
SystemFontService
will fetch a new batch.
Implementations§
source§impl SystemFontService
impl SystemFontService
pub fn spawn( compositor_api: CrossProcessCompositorApi, ) -> SystemFontServiceProxySender
fn run(&mut self)
fn fetch_new_keys(&mut self)
fn get_font_templates( &mut self, font_descriptor: Option<FontDescriptor>, font_family: SingleFontFamily, ) -> Vec<FontTemplate>
fn refresh_local_families(&mut self)
fn find_font_templates( &mut self, descriptor_to_match: Option<&FontDescriptor>, family: &SingleFontFamily, ) -> Vec<FontTemplateRef>
fn get_font_instance( &mut self, identifier: FontIdentifier, pt_size: Au, flags: FontInstanceFlags, ) -> FontInstanceKey
pub(crate) fn family_name_for_single_font_family( &mut self, family: &SingleFontFamily, ) -> LowercaseFontFamilyName
Auto Trait Implementations§
impl !Freeze for SystemFontService
impl !RefUnwindSafe for SystemFontService
impl Send for SystemFontService
impl !Sync for SystemFontService
impl Unpin for SystemFontService
impl !UnwindSafe for SystemFontService
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
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