Skip to main content

register_virtual_font_bytes

Function register_virtual_font_bytes 

Source
pub fn register_virtual_font_bytes(
    path: impl Into<PathBuf>,
    bytes: impl Into<Vec<u8>>,
)
Expand description

Register a virtual font file in memory.

This is primarily used by wasm/browser hosts that do not have a real filesystem/fontconfig database. Callers can return the same virtual path from their FontProvider; shaping and rasterization will then load bytes from this cache instead of std::fs.