wch / extrafont

Tools for using fonts in R graphics
312 stars 49 forks source link

font_import() is missing some fonts #75

Open GGnanadesikan opened 4 years ago

GGnanadesikan commented 4 years ago

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.

MaximilianR commented 3 years ago

Try this, but change "XXX" to your Windows username:

font_import(paths = "C:/Users/XXX/AppData/Local/Microsoft/Windows")

kulbhushanchand commented 3 years ago

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 -

PS: The first method is faster because of relatively fewer fonts in C:/Users/XXX/AppData/Local/Microsoft/Windows than in C:/Windows/Fonts/