load_custom_font_family

Function load_custom_font_family 

Source
pub fn load_custom_font_family(
    name: &str,
    custom_paths: &[PathBuf],
) -> Result<FontFamily<FontData>, Error>
Expand description

Attempts to load a font family from custom paths first, then falls back to system fonts. This function searches user-specified directories or files before looking in system fonts.

§Arguments

  • name - The font family name to search for
  • custom_paths - Custom directories or font files to search

§Returns

  • Ok(FontFamily<FontData>) if the font is found and loaded successfully
  • Err(Error) if the font cannot be found in any location

§Search order

  1. Custom paths (if provided) - searches for exact matches or files containing the name
  2. System fonts via fontdb
  3. Returns error if not found