我正在尝试让xkcd字体在R中与ggplot2兼容。然而,我遇到了一些问题。以下是我到目前为止所做的工作。1)从~/.fonts目录下的xkcd站点安装了"Humor Sans“字体。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
发布于 2013-05-13 01:09:10
您是否尝试过:
font_import(paths = "~/.fonts", pattern="Humor Sans")在我看来,"~/.fonts“不是Mac的默认字体文件夹,所以如果它是(或不是)您的操作系统,您应该在编辑原始问题时包含更多详细信息。
https://stackoverflow.com/questions/16509719
复制相似问题