R ggplot2 font release

I am trying to get xkcd fonts working in R with ggplot2. However, I run into some problems. Here is what I have done so far. 1) The font "Humor" is installed from the xkcd site in the ~ / .fonts directory 2) The "extrafont" package is installed. This setup worked smoothly. 3) Download the library

library(extrafont) 

However, when I try to import a 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 can do wrong or what else should I do? Thank you very much in advance

edit: Running ubuntu 12.04

+4
source share
1 answer

You tried:

 font_import(paths = "~/.fonts", pattern="Humor Sans") 

It doesn't seem to me that "~ / .fonts" is the default font folder for Mac, so if it is (or not) your OS, you should include more detailed information when editing the original question.

+1
source

Source: https://habr.com/ru/post/1480351/


All Articles