load_fonts: Load the font files needed for the theme

View source: R/fonts.R

load_fontsR Documentation

Load the font files needed for the theme

Description

This function is used to load the font files needed for the theme. It is called automatically when the package loads. By default it looks for the required files in a standard location: a folder in the user's home directory called .clcharts.

Usage

load_fonts(
  national_semibold = getOption("clcharts.national_semibold"),
  national_book = getOption("clcharts.national_book"),
  open_sans_regular = getOption("clcharts.open_sans_regular"),
  open_sans_bold = getOption("clcharts.open_sans_bold")
)

Arguments

national_semibold

Path to the font file for National-Semibold

national_book

Path to the font file for National-Book

open_sans_regular

Path to the font file for OpenSans-Regular

open_sans_bold

Path to the font file for OpenSans-Regular

Details

This function is needed because there are too many inconsistencies in the way R handles fonts on different operating systems. Rather than trying to find and load the correct system fonts in all circustances, a font bundle is available to package users which contains the licensed fonts.


houseofcommonslibrary/clcharts documentation built on June 10, 2025, 9:16 p.m.