extrafont
extrafont copied to clipboard
font_import() is missing some fonts
I installed some new truetype fonts that I wanted to use (and they work fine in MS Word), but font_import() skips right over it. I've also tried specifying the path and specifying the filename with the pattern argument. No luck.
I just get the following error: Error in data.frame(fontfile = ttfiles, FontName = "", stringsAsFactors = FALSE) : arguments imply differing number of rows: 0, 1
I also tried resetting the database and importing everything again, and it skips right over them.
Try this, but change "XXX" to your Windows username:
font_import(paths = "C:/Users/XXX/AppData/Local/Microsoft/Windows")
Adding to above answer -
Fonts installed for all users goes to - C:/Windows/Fonts/
Fonts installed for single user goes to - C:/Users/XXX/AppData/Local/Microsoft/Windows/Fonts/
(where XXX is Windows Username)
Solution -
-
font_import(paths = "C:/Users/XXX/AppData/Local/Microsoft/Windows")
OR - Go to
C:/Users/XXX/AppData/Local/Microsoft/Windows"
, select all, right-click, selectInstall for all users
, and in R useextrafonts::font_import()
PS: The first method is faster because of relatively fewer fonts in C:/Users/XXX/AppData/Local/Microsoft/Windows
than in C:/Windows/Fonts/