简体   繁体   English

R 中的“font_import()”无法识别 Raleway 字体

[英]Raleway font not recognized by “font_import()” in R

I am currently working in RStudio Version 1.2.5033 I have Raleway ("Raleway.ttf") fully installed on my computer (Windows 10 OS).我目前在 RStudio 版本 1.2.5033 工作我在我的计算机(Windows 10 操作系统)上完全安装了 Raleway(“Raleway.ttf”)。 When I run through the standard font_import() protocol from the extrafont package, it checks through the majority of fonts on my computer, but does not import or check Raleway.当我从 extrafont package 运行标准font_import()协议时,它会检查我计算机上的大部分 fonts,但不会导入或检查 Raleway。

When I specifically dictate font_import("Raleway") or font_import("Raleway.ttf") I get the following error:当我特别指定font_import("Raleway")font_import("Raleway.ttf") 时,我收到以下错误:

Error in data.frame(fontfile = ttfiles, FontName = "", stringsAsFactors = FALSE): arguments imply differing number of rows: 0, 1 data.frame 中的错误(fontfile = ttfiles,FontName = "",stringsAsFactors = FALSE):arguments 暗示不同的行数:0、1

Is anyone familiar with what this problem may be?有谁熟悉这个问题可能是什么? Is it a font-specific issue?这是字体特定的问题吗? Or something I am doing wrong on my end?或者我做错了什么? Thank you for any help you can give.感谢您提供的任何帮助。

I have already uninstalled and reinstalled the font several times, and restarted my entire computer after doing so, and had no luck.我已经卸载并重新安装了几次字体,然后重新启动了整个计算机,但没有运气。

I've had this issue on Windows when the font is installed in the User directory.当字体安装在用户目录中时,我在 Windows 上遇到了这个问题。 For example, if I install a new font on Windows 10, it goes to C:\Users\grego\Appdata\Local\Microsoft\Windows\Fonts\ , but extrafont looks in C:\Windows\Fonts .例如,如果我在 Windows 10 上安装新字体,它会转到C:\Users\grego\Appdata\Local\Microsoft\Windows\Fonts\ ,但extrafont看起来在C:\Windows\FontsYou can check where the font is installed if you open up Fonts in the Control Panel and click on the font, there should be a "Font File" entry with the full file path.如果您在控制面板中打开 Fonts 并单击字体,则可以检查字体的安装位置,应该有一个带有完整文件路径的“字体文件”条目。

I've had no luck getting Windows to install the font for all users through the GUI installer (though it may be as simple as dropping the TTF file in the C:\Windows\Fonts\ directory...), but pointing extrafont to the correct folder has worked: extrafont::font_import(paths = "C:/Users/grego/Appdata/Local/Microsoft/Windows/Fonts/", ...)我没有运气让 Windows 通过 GUI 安装程序为所有用户安装字体(尽管它可能就像将 TTF 文件放在C:\Windows\Fonts\目录中一样简单......),但指向extrafont正确的文件夹有效: extrafont::font_import(paths = "C:/Users/grego/Appdata/Local/Microsoft/Windows/Fonts/", ...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM