【发布时间】:2021-11-06 18:24:33
【问题描述】:
我正在尝试将 Windows 字体导入 R/R.Stuido(与 Windows 10 一起使用的两个最新版本)。前段时间,我在另一台 Windows 10 设备上使用此代码成功:
install.packages("pkgbuild")
library(extrafont)
library(remotes)
remotes::install_version("Rttf2pt1", version = "1.3.8")
extrafont::font_import()
当我尝试在实际设备上重新运行该设备时,我在安装相应的 Rttf2pt1 版本时遇到了麻烦。似乎遇到了安装问题,错误信息如下:
Downloading package from url: https://cran.rstudio.com//src/contrib/Archive/Rttf2pt1/Rttf2pt1_1.3.8.tar.gz
Installing package into ‘C:/Users/.../R/win-library/4.1’
(as ‘lib’ is unspecified)
* installing *source* package 'Rttf2pt1' ...
** package 'Rttf2pt1' successfully unpacked and MD5 sums checked
** using staged installation
** libs
running 'src/Makefile.win' ...
echo "make ttf2pt1 in ttf2pt1/ ..."
make ttf2pt1 in ttf2pt1/ ...
(cd ttf2pt1; /c/PROGRA~1/rtools40/usr/bin/make -f "C:/PROGRA~1/R/R-41~1.1/etc/x64/Makeconf" -f Makefile CC="`"C:/PROGRA~1/R/R-41~1.1/bin/R" CMD config CC`" CFLAGS="`"C:/PROGRA~1/R/R-41~1.1/bin/R" CMD config CFLAGS` -DWINDOWS -Wno-comment -Wno-format -Wno-logical-op-parentheses -Wno-pointer-sign -Wno-unused-function -Wno-unused-variable -Wno-parentheses -Wno-unused-label -Wno-maybe-uninitialized -Wno-unused-but-set-variable -Wno-unused-value" ttf2pt1)
C:/Program Files/rtools40/mingw64/bin/gcc -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -DWINDOWS -Wno-comment -Wno-format -Wno-logical-op-parentheses -Wno-pointer-sign -Wno-unused-function -Wno-unused-variable -Wno-parentheses -Wno-unused-label -Wno-maybe-uninitialized -Wno-unused-but-set-variable -Wno-unused-value -c ttf2pt1.c
make[1]: C:/Program: Command not found
make[1]: *** [Makefile:185: ttf2pt1.o] Error 127
make: *** [Makefile.win:16: all] Error 2
ERROR: compilation failed for package 'Rttf2pt1'
* removing 'C:/Users/.../R/win-library/4.1/Rttf2pt1'
* restoring previous 'C:/Users/.../R/win-library/4.1/Rttf2pt1'
Warning message:
In i.p(...) :
installation of package ‘C:/Users/.../Rttf2pt1’ had non-zero exit status
任何想法如何解决这个问题?谢谢你的帮助
【问题讨论】:
标签: r windows installation import fonts