使用extrafont包将字体导入R [英] Import font into R using extrafont package

查看:728
本文介绍了使用extrafont包将字体导入R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用extrafont包将Garamond导入R.使用指向字体位置文件夹的未指定font_import()函数时,我能够成功导入其他字体,但是我错过了该文件夹中的几种字体.有什么建议为什么只导入某些字体而不导入某些字体?

I'm trying to import Garamond into R using the extrafont package. I am able to successfully import other fonts when using the unspecified font_import() function directed towards the font location folder, but I'm missing out several fonts located in that folder. Any suggestion why only some fonts are imported and others not?

我尝试过

font_import(pattern = "Garamond.ttf")
ttf_import(pattern = "Garamond.ttf")

,并显示以下错误消息:

with the following error message:

扫描/Library/Fonts/,/System/Library/Fonts,〜/Library/Fonts/中的ttf文件... 从.ttf文件中提取.afm文件... data.frame中的错误(fontfile = ttfiles,FontName =",stringsAsFactors = FALSE): 参数暗示不同的行数:0,1

Scanning ttf files in /Library/Fonts/, /System/Library/Fonts, ~/Library/Fonts/ ... Extracting .afm files from .ttf files... Error in data.frame(fontfile = ttfiles, FontName = "", stringsAsFactors = FALSE) : arguments imply differing number of rows: 0, 1

推荐答案

font_import(pattern = 'GARAIT')

为了知道正确的名称,请右键单击已安装的TTF字体,选择属性,然后使用常规"标签顶部显示的名称.

In order to know the correct name, right click in your installed TTF font, select properties an use the name showed at the top of the "General" tab.

这篇关于使用extrafont包将字体导入R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆