Size: 827
Comment:
|
← Revision 3 as of 2023-06-15 13:59:20 ⇥
Size: 956
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 13: | Line 13: |
Install the `sysfonts` package. | [[R/InstallingPackages|Install]] the `sysfonts` package. |
Line 42: | Line 42: |
In any case, it is likely necessary to now use [[R/Showtext|showtext]] to rasterize the fonts added. |
R Sysfonts
The sysfonts package imports fonts from the system registry into R's registry.
Contents
Installation
Install the sysfonts package.
Usage
If a font must be downloaded from the internet, try:
download.file(uri, basename(uri)) untar(basename(uri), compressed = "gzip")
With the font file available locally, try:
sysfonts::font_add("myfont", r"(path/to/myfontdir/myfont.otf)")
Alternatively, add the font file to the search path so that it can be used without a path.
library(sysfonts) font_paths("path/to/myfontdir") font_add("myfont", regular = "myfont.otf")
In any case, it is likely necessary to now use showtext to rasterize the fonts added.