pub(crate) struct FontStore {
pub(crate) families: HashMap<LowercaseFontFamilyName, FontTemplates>,
web_fonts_loading_for_stylesheets: Vec<(DocumentStyleSheet, usize)>,
web_fonts_loading_for_script: usize,
}Fields§
§families: HashMap<LowercaseFontFamilyName, FontTemplates>§web_fonts_loading_for_stylesheets: Vec<(DocumentStyleSheet, usize)>§web_fonts_loading_for_script: usizeImplementations§
Source§impl FontStore
impl FontStore
pub(crate) fn clear(&mut self)
pub(crate) fn font_load_cancelled_for_stylesheet( &self, stylesheet: &DocumentStyleSheet, ) -> bool
pub(crate) fn handle_stylesheet_removed( &mut self, stylesheet: &DocumentStyleSheet, )
pub(crate) fn handle_web_font_load_started_for_stylesheet( &mut self, stylesheet: &DocumentStyleSheet, )
fn remove_one_web_font_loading_for_stylesheet( &mut self, stylesheet: &DocumentStyleSheet, )
pub(crate) fn handle_web_font_load_failed_for_stylesheet( &mut self, stylesheet: &DocumentStyleSheet, )
Sourcepub(crate) fn handle_web_font_loaded_for_stylesheet(
&mut self,
stylesheet: &DocumentStyleSheet,
family_name: LowercaseFontFamilyName,
new_template: FontTemplate,
) -> bool
pub(crate) fn handle_web_font_loaded_for_stylesheet( &mut self, stylesheet: &DocumentStyleSheet, family_name: LowercaseFontFamilyName, new_template: FontTemplate, ) -> bool
Handle a web font load finishing, adding the new font to the FontStore. If the web font
load was canceled (for instance, if the stylesheet was removed), then do nothing and return
false.
pub(crate) fn add_new_template( &mut self, family_name: LowercaseFontFamilyName, new_template: FontTemplate, )
pub(crate) fn handle_web_font_load_started_for_script(&mut self)
pub(crate) fn handle_web_font_load_finished_for_script(&mut self)
pub(crate) fn number_of_fonts_still_loading(&self) -> usize
Trait Implementations§
Source§impl MallocSizeOf for FontStore
impl MallocSizeOf for FontStore
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.
Auto Trait Implementations§
impl Freeze for FontStore
impl !RefUnwindSafe for FontStore
impl Send for FontStore
impl Sync for FontStore
impl Unpin for FontStore
impl !UnwindSafe for FontStore
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