我正在尝试在使用ggplot2的R中使用xkcd字体。然而,我遇到了一些问题。 以下是我目前所做的: 1)从xkcd网站上安装了“Humor Sans”字体,并将其放置在目录~ / .fonts中。 2)安装了“extrafont”包。这个安装很顺利。 3)加载库。
library(extrafont)
然而,当我尝试导入字体时,出现了以下错误。
> 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
有没有什么建议,我可能做错了什么或者还需要做什么? 提前感谢您的帮助。
编辑:运行ubuntu 12.04