Metropolitan-Council / councilR

A curated collection of commonly used templates, color palettes, functions, and more!
Other
6 stars 1 forks source link

theme_council() font error on Windows machines #38

Closed eroten closed 1 year ago

eroten commented 1 year ago

Some Windows users aren't able to install fonts system-wide, though they can install fonts within their user. However, sysfonts::font_paths() only looks for font files in the system-wide directory

library(councilR)
library(sysfonts)
library(showtext)
#> Loading required package: showtextdb
font_add(regular="HelveticaNeueLTStd", "HelveticaNeueLTStd-Lt.otf")
#> Error in check_font_path(regular, "regular"): font file not found for 'regular' type

This patch creates a conditional in theme_council(), such that Windows users will load additional font paths and Mac users will be unaffected.

Additional documentation fixes and Roxygen update are included.

closes #37