3

I am currently working in RStudio Version 1.2.5033 I have Raleway ("Raleway.ttf") fully installed on my computer (Windows 10 OS). When I run through the standard font_import() protocol from the extrafont package, it checks through the majority of fonts on my computer, but does not import or check Raleway.

When I specifically dictate font_import("Raleway") or font_import("Raleway.ttf") I get the following error:

Error in data.frame(fontfile = ttfiles, FontName = "", stringsAsFactors = FALSE) : arguments imply differing number of rows: 0, 1

Is anyone familiar with what this problem may be? Is it a font-specific issue? Or something I am doing wrong on my end? Thank you for any help you can give.

I have already uninstalled and reinstalled the font several times, and restarted my entire computer after doing so, and had no luck.

1 Answers1

1

I've had this issue on Windows when the font is installed in the User directory. For example, if I install a new font on Windows 10, it goes to C:\Users\grego\Appdata\Local\Microsoft\Windows\Fonts\, but extrafont looks in C:\Windows\Fonts. You can check where the font is installed if you open up Fonts in the Control Panel and click on the font, there should be a "Font File" entry with the full file path.

I've had no luck getting Windows to install the font for all users through the GUI installer (though it may be as simple as dropping the TTF file in the C:\Windows\Fonts\ directory...), but pointing extrafont to the correct folder has worked: extrafont::font_import(paths = "C:/Users/grego/Appdata/Local/Microsoft/Windows/Fonts/", ...)

Gregor Thomas
  • 136,190
  • 20
  • 167
  • 294
  • I appreciate the thought. I went back and made sure they were installed in the Windows\Fonts\ directory, but am still seeing the same issue. This font (and three other fonts I've downloaded since then) are all completely skipped over by the font_import() function. There are a couple fonts that give me specific errors, but none of the fonts I am looking for are listed in those specific font_import() warning messages. I'm truly baffled by this one. – Joshua Mansfield Jul 01 '20 at 00:54
  • 1
    For what it's worth, I had the exact same issue and it turned out I had the wrong file path. After putting a few `browser()`s into extrafont's functions, I _triple-checked_ the filepath using `list.files(font_path)` and found it was not going where I thought it would (and thus `font_import(font_path)` was not finding any files). I have not had an issue with any font since correcting this. – MokeEire Aug 21 '20 at 17:23