I'm trying to get the xkcd fonts working in R with ggplot2. However I'm running into some issues. Here is what I have done so far. 1) Installed the "Humor Sans" font from the xkcd site in the directory ~/.fonts 2) Installed the "extrafont" package. This installation worked smoothly. 3) Load the library
library(extrafont)
However when I try to import the font I get the following error.
> font_import(pattern="Humor Sans")
Importing fonts may take a few minutes, depending on the number of fonts and the speed of the system.
Continue? [y/n] y
Scanning ttf files in /usr/share/fonts/, ~/.fonts/ ...
Extracting .afm files from .ttf files...
Error in data.frame(fontfile = ttfiles, FontName = "", stringsAsFactors = FALSE) :
arguments imply differing number of rows: 0, 1
Any suggestions on what I could be doing wrong or what else I should be doing? Thanks much in advance
edit: Running ubuntu 12.04
Have you tried:
font_import(paths = "~/.fonts", pattern="Humor Sans")
It does not appear to me that "~/.fonts" is the default font folder for a Mac, so if that is (or is not) your OS, you should include more details when you edit your original question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With