zng_app::render

Trait Font

source
pub trait Font {
    // Required methods
    fn is_empty_fallback(&self) -> bool;
    fn renderer_id(
        &self,
        renderer: &ViewRenderer,
        synthesis: FontSynthesis,
    ) -> FontId;
}
Expand description

A text font.

This trait is an interface for the renderer into the font API used in the application.

Required Methods§

source

fn is_empty_fallback(&self) -> bool

Gets if the font is the fallback that does not have any glyph.

source

fn renderer_id( &self, renderer: &ViewRenderer, synthesis: FontSynthesis, ) -> FontId

Gets the instance key in the renderer namespace.

The font configuration must be provided by self, except the synthesis that is used in the font instance.

Implementors§