简体   繁体   English

如何解决extrafont中的错误状态5?

[英]How to solve the error status 5 in extrafont?

My aim is to use the font xkcd.tff .我的目标是使用字体xkcd.tff I checked that it's installed in the dir我检查它是否安装在目录中

C:/Users/prgca/AppData/Local/Microsoft/Windows/Fonts

once I有一次,我

font_import(path = "C:/Users/prgca/AppData/Local/Microsoft/Windows/Fonts",
             pattern = "xkcd")

This is the output这是输出

Scanning ttf files in C:/Users/prgca/AppData/Local/Microsoft/Windows/Fonts ...
Extracting .afm files from .ttf files...
C:\Users\prgca\AppData\Local\Microsoft\Windows\Fonts\xkcd.ttf : No FontName. Skipping.
Found FontName for 0 fonts.
Scanning afm files in C:/Users/prgca/Documents/R/win-library/4.1/extrafontdb/metrics
Warning message:
In system2(enc2native(ttf2pt1), c(args, shQuote(ttfiles[i]), shQuote(tmpfiles[i])),  :
  running command '"C:/Users/prgca/Documents/R/win-library/4.1/Rttf2pt1/exec/ttf2pt1.exe" -a -G fAe "C:\Users\prgca\AppData\Local\Microsoft\Windows\Fonts\xkcd.ttf" "C:\Users\prgca\AppData\Local\Temp\RtmpSMiy86/fonts/xkcd"' had status 5

The font is, indeed, not loaded into my plots.确实,字体没有加载到我的情节中。 How can I load it?我怎样才能加载它?

I suspect this is related to issues with Rttf2pt1 (upon which extrafont depends) as described here and here .我怀疑这与此处此处所述的 Rttf2pt1(取决于 extrafont)的问题有关。 Suggested solution which worked for me is to downgrade Rttf2pt1 as below:对我有用的建议解决方案是将 Rttf2pt1 降级如下:

remove.packages("Rttf2pt1")   
remotes::install_version("Rttf2pt1", version = "1.3.8") 

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

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