pub fn font(&mut self, font_id: &FontId) -> &mut Font {
        let FontId { size, family } = font_id;
        let scale_in_pixels = self.font_impl_cache.scale_as_pixels(*size);

        self.sized_family
            .entry((scale_in_pixels, family.clone()))
            .or_insert_with(|| {
                let fonts = &self.definitions.families.get(family);
                let fonts = fonts.unwrap_or_else(|| {
                    panic!("FontFamily::{:?} is not bound to any fonts", family)
                });

                let fonts: Vec<Arc<FontImpl>> = fonts
                    .iter()
                    .map(|font_name| self.font_impl_cache.font_impl(scale_in_pixels, font_name))
                    .collect();

                Font::new(fonts)
            })
    }
/// Get the right font implementation from size and [`FontFamily`].
Get the right font implementation from size and [`FontFamily`].
Get the right font implementation from size and [ ` FontFamily ` ] .
pub fn font(&mut self, font_id: &FontId) -> &mut Font {
        let FontId { size, family } = font_id;
        let scale_in_pixels = self.font_impl_cache.scale_as_pixels(*size);
        self.sized_family
            .entry((scale_in_pixels, family.clone()))
            .or_insert_with(|| {
                let fonts = &self.definitions.families.get(family);
                let fonts = fonts.unwrap_or_else(|| {
                    panic!("FontFamily::{:?} is not bound to any fonts", family)
                });
                let fonts: Vec<Arc<FontImpl>> = fonts
                    .iter()
                    .map(|font_name| self.font_impl_cache.font_impl(scale_in_pixels, font_name))
                    .collect();
                Font::new(fonts)
            })
    }
pub fn font ( & mut self , font_id : & FontId ) -> & mut Font { let FontId { size , family } = font_id ; let scale_in_pixels = self . font_impl_cache . scale_as_pixels ( * size ) ; self . sized_family . entry ( ( scale_in_pixels , family . clone ( ) ) ) . or_insert_with ( | | { let fonts = & self . definitions . families . get ( family ) ; let fonts = fonts . unwrap_or_else ( | | { panic ! ( " " family ) } ) ; let fonts : Vec < Arc < FontImpl > > = fonts . iter ( ) . map ( | font_name | self . font_impl_cache . font_impl ( scale_in_pixels , font_name ) ) . collect ( ) ; Font :: new ( fonts ) } ) }
Get the right font implementation from size and [`FontFamily`].
Get the right font implementation from size and [ ` FontFamily ` ] .
&mut self
font_id
&FontId
&mut self
font_id
&FontId