extrafont icon indicating copy to clipboard operation
extrafont copied to clipboard

font_import() is missing some fonts

Open GGnanadesikan opened this issue 4 years ago • 2 comments

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.

GGnanadesikan avatar May 24 '20 23:05 GGnanadesikan

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

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

MaximilianR avatar Jan 06 '21 22:01 MaximilianR

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, select Install for all users, and in R use extrafonts::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/

kulbhushanchand avatar Feb 22 '21 17:02 kulbhushanchand