wch / extrafont

Tools for using fonts in R graphics
315 stars 48 forks source link

windowFonts() not recognized in .Rprofile #83

Closed mark-druffel closed 3 years ago

mark-druffel commented 3 years ago

I added loadfonts to my project .Rprofile and got an error saying no function The functions work in blogdown, but not in .Rprofile. I realized after opening the ticket that this is because grDevices does not load before .Rprofile (I think). Below is the error.

library(extrafont)
loadfonts("win", quiet = F)

Error in get(as.character(FUN), mode = "function", envir = envir) : 
  object 'windowsFonts' of mode 'function' was not found
Calls: <Anonymous> -> match.fun -> get
Execution halted

I was able to fix it with the code below. Closing the issue.

library(grDevices)
library(extrafont)
loadfonts("win", quiet = F)

Registering fonts with R
liamxg commented 3 years ago

how to install the font of "Young"?

liamxg commented 3 years ago

library(grDevices)

library(extrafont) loadfonts("win", quiet = F) Error in windowsFonts() : could not find function "windowsFonts"

liamxg commented 3 years ago

i am using Mac.