我的目标是使用字体xkcd.tff
。我检查它是否安装在目录中
C:/Users/prgca/AppData/Local/Microsoft/Windows/Fonts
曾经我
font_import(path = "C:/Users/prgca/AppData/Local/Microsoft/Windows/Fonts",
pattern = "xkcd")
这是输出
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
字体确实没有加载到我的图中。 我怎样才能加载它?
最佳答案
我怀疑这与 Rttf2pt1(extrafont 所依赖的)问题有关,如 here 中所述。和 here 。对我有用的建议解决方案是降级 Rttf2pt1,如下所示:
remove.packages("Rttf2pt1")
remotes::install_version("Rttf2pt1", version = "1.3.8")
关于r - 如何解决extrafont中的错误状态5?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72435931/