load_builtin_font_family

Function load_builtin_font_family 

Source
pub fn load_builtin_font_family(
    name: &str,
) -> Result<FontFamily<FontData>, Error>
Expand description

Attempts to load a built-in PDF font family using only the PDF built-in fonts without any system font dependencies. This ensures consistent character spacing across all platforms and avoids kerning issues.

The function supports the three standard PDF font families:

  • Helvetica (fallback name: “Arial”)
  • Times (fallback names: “Times New Roman”, “Times”)
  • Courier (fallback name: “Courier New”)

Built-in PDF fonts use standardized Adobe Font Metrics (AFM) and do not require any font embedding, resulting in smaller PDF files with consistent rendering across all PDF viewers.