pub fn add_font<P: AsRef<std::path::Path>>(&mut self, alias: &'static str, font_path: P) {
        let font_bytes = std::fs::read(font_path)
            .unwrap();
        let font = ab_glyph::FontArc::try_from_vec(font_bytes)
            .unwrap();

        let id = self.brush.add_font(font);

        if let Some(FontId(existing_id)) = self.fonts.insert(alias, id) {
            panic!("A font with alias `{}` already exists (FontId: {})", alias, existing_id);
        }
    }
/// Add a font for rendering. Font will be referred to by its unique, given alias.
Add a font for rendering. Font will be referred to by its unique, given alias.
Add a font for rendering . Font will be referred to by its unique given alias .
pub fn add_font<P: AsRef<std::path::Path>>(&mut self, alias: &'static str, font_path: P) {
        let font_bytes = std::fs::read(font_path)
            .unwrap();
        let font = ab_glyph::FontArc::try_from_vec(font_bytes)
            .unwrap();
        let id = self.brush.add_font(font);
        if let Some(FontId(existing_id)) = self.fonts.insert(alias, id) {
            panic!("A font with alias `{}` already exists (FontId: {})", alias, existing_id);
        }
    }
pub fn add_font < P : AsRef < std :: path :: Path > > ( & mut self , alias : & ' static str , font_path : P ) { let font_bytes = std :: fs :: read ( font_path ) . unwrap ( ) ; let font = ab_glyph :: FontArc :: try_from_vec ( font_bytes ) . unwrap ( ) ; let id = self . brush . add_font ( font ) ; if let Some ( FontId ( existing_id ) ) = self . fonts . insert ( alias , id ) { panic ! ( " " alias existing_id ) ; } }
Add a font for rendering.
Add a font for rendering .
&mut self
alias
&'static str
font_path
P
&mut self
alias
&'static str
font_path
P