An R package that simplifies using system and custom TrueType fonts in PDF, PostScript, and Windows bitmap graphics output.
extrafont is an R package that manages and embeds system and custom TrueType fonts for use in PDF, PostScript, and Windows bitmap graphics output. It solves the problem of R's limited default font support by automating font metric extraction and embedding, enabling the creation of portable, professionally typeset documents.
R users, particularly data scientists and analysts creating reports, publications, or presentations that require consistent, branded typography beyond R's basic PostScript fonts.
Developers choose extrafont because it streamlines the entire font workflow in R—from discovery and registration to embedding—eliminating manual Ghostscript configuration and ensuring output files render correctly on any device.
Tools for using fonts in R graphics
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Scans the system for TrueType fonts, extracts metrics, and registers them in a database, eliminating manual font metric handling as described in the import process.
Uses Ghostscript to embed fonts into PDFs, ensuring portable and correct rendering on devices without the font installed, which is critical for sharing documents.
Extends font availability to on-screen and bitmap graphics output on Windows, a unique feature not covered by base R or many alternatives.
Supports PostScript Type 1 fonts packaged as R packages, like Computer Modern fonts, enabling specialized typography without system installation.
Only supports TrueType fonts currently, with the README noting that support for other kinds 'will be added in the future,' leaving gaps for modern font types.
Requires external Ghostscript installation and configuration, especially on Windows where per-session path setting is needed, adding setup complexity and potential cross-platform issues.
Fonts must be registered per session with loadfonts() and embedded for each PDF file, making batch workflows repetitive and error-prone without automation.