pub fn load_font_with_fallbacks(
primary_name: &str,
fallback_names: &[String],
custom_paths: &[PathBuf],
text: Option<&str>,
) -> Result<FontFamily<FontData>, Error>Expand description
Loads a font with fallback support for better coverage (legacy function).
This function tries to find the best font for the given text by:
- Loading the primary font
- Loading all fallback fonts
- Checking coverage for each
- Selecting the font with the best coverage
Note: This function is kept for backward compatibility. New code should use
load_font_with_fallback_chain() which returns actual fallback chains instead
of selecting a single best font.
§Arguments
primary_name- Name of the primary font to loadfallback_names- List of fallback font names to trycustom_paths- Custom paths to search for fontstext- Optional text to check coverage for
§Returns
The font with the best coverage for the given text