Sometimes, even when fonts are loaded on a computer, they are not immediately available for use in R. This function fixes that.
Details
See June Choe's blog post explaining this.
This function requires the user to have already downloaded the
font on their computer, and to have set up ragg
as described
in the blog post.
Examples
# load Roboto (must be loaded from Google Fonts on system already)
font_hoist("Roboto")
#> No fonts found for the family 'Roboto'.
#> Make sure that the font is downloaded to your computer, and that you can find it using systemfonts::system_fonts().
#> $specs
#> NULL
#>
#> $available
#> [1] FALSE
#>
# Try loading a font not on your computer, or that doesn't exist.
# It will give an informative error message.
font_hoist("Lobster Monster")
#> No fonts found for the family 'Lobster Monster'.
#> Make sure that the font is downloaded to your computer, and that you can find it using systemfonts::system_fonts().
#> $specs
#> NULL
#>
#> $available
#> [1] FALSE
#>