Closed lcpilling closed 8 months ago
I like this, especially for when a font has a nice open license (like the Dune Rise font).
Do you mind adding a test for this theme? (Run usethis::use_test()
with the R file open, then copy from one of the other test theme files?)
I have added the test.
I also changed it so that the "local" option passed is the actual font filename in case it differs from what the uploader wants the "family"/"name" to be
Thanks for adding the test, this looks like a great addition to me.
This looks awesome!
This PR comes with two changes! I wanted to create a DUNE theme but the font is not available on Google Fonts. However people have made amazing fonts (e.g., https://www.dafont.com/dune-rise.font) and the {sysfonts} package has a function to import local font files. I have therefore added the possibility for a theme to specify that the font should be loaded locally. The creator needs to put the font file in
/inst/fonts/
and it is simplest if the file has the name that the family will use.For Dune, I downloaded the
Dune_Rise.ttf
font file and put it in/inst/fonts/
The utils function now has an extra option "local" where the theme can specify the filename without the suffix:
So for
theme_dune
the font part looks like:The long and short of it is that this new DUNE font has the films colour palette, and uses a local font.
Examples!