Skip to main content

FontLoader

Trait FontLoader 

Source
pub trait FontLoader {
    // Required method
    fn load(&self, url: &str) -> Option<Vec<u8>>;
}
Expand description

Resolves @font-face sources to font bytes.

The engine reads no paths of its own. Whatever string the sheet writes in url() is handed over as it is: it never has to be a real URL, and a host that resolves nothing is a host with no author fonts.

Required Methods§

Source

fn load(&self, url: &str) -> Option<Vec<u8>>

The bytes behind one src url, or None when the host cannot resolve it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§