load_font_family_with_variants

Function load_font_family_with_variants 

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

Loads a font family with proper variant files (Bold, Italic, BoldItalic).

This function searches for actual variant font files instead of reusing the regular font for all styles. Falls back to regular font if variants aren’t found.

§Arguments

  • name - The font family base name
  • custom_paths - Directories to search for font files

§Returns

A FontFamily with actual variant files loaded