pub fn from_default_font<P: AsRef<std::path::Path>>(default_font_alias: &'static str, font_path: P, device: &wgpu::Device, render_format: wgpu::TextureFormat) -> Self {
        let font_bytes = std::fs::read(font_path)
            .unwrap();
        let font = ab_glyph::FontArc::try_from_vec(font_bytes)
            .unwrap();

        let brush = GlyphBrushBuilder::using_font(font)
            .build(device, render_format);
        
        let mut fonts = HashMap::new();
        fonts.insert(default_font_alias, Self::DEFAULT_FONT_ID);

        Self {
            brush,
            fonts,
        }
    }
/// Creates a `TextRenderer` with an aliased default font.
/// 
/// A default font is required, but this can be treated like adding any regular font via `add_font`
Creates a `TextRenderer` with an aliased default font.
A default font is required, but this can be treated like adding any regular font via `add_font`
Creates a ` TextRenderer ` with an aliased default font . A default font is required but this can be treated like adding any regular font via ` add_font `
pub fn from_default_font<P: AsRef<std::path::Path>>(default_font_alias: &'static str, font_path: P, device: &wgpu::Device, render_format: wgpu::TextureFormat) -> Self {
        let font_bytes = std::fs::read(font_path)
            .unwrap();
        let font = ab_glyph::FontArc::try_from_vec(font_bytes)
            .unwrap();
        let brush = GlyphBrushBuilder::using_font(font)
            .build(device, render_format);
        let mut fonts = HashMap::new();
        fonts.insert(default_font_alias, Self::DEFAULT_FONT_ID);
        Self {
            brush,
            fonts,
        }
    }
pub fn from_default_font < P : AsRef < std :: path :: Path > > ( default_font_alias : & ' static str , font_path : P , device : & wgpu :: Device , render_format : wgpu :: TextureFormat ) -> Self { let font_bytes = std :: fs :: read ( font_path ) . unwrap ( ) ; let font = ab_glyph :: FontArc :: try_from_vec ( font_bytes ) . unwrap ( ) ; let brush = GlyphBrushBuilder :: using_font ( font ) . build ( device , render_format ) ; let mut fonts = HashMap :: new ( ) ; fonts . insert ( default_font_alias , Self :: DEFAULT_FONT_ID ) ; Self { brush , fonts , } }
Creates a `TextRenderer` with an aliased default font.
Creates a ` TextRenderer ` with an aliased default font .
default_font_alias
&'static str
font_path
P
device
&wgpu::Device
render_format
wgpu::TextureFormat
default_font_alias
&'static str
font_path
P
device
&wgpu::Device
render_format
wgpu::TextureFormat