r - R中的pdffonts中的额外字体
问题描述
运行名称时列出了以下字体(pdfFonts())
> names(pdfFonts())
[1] "serif" "sans" "mono" "AvantGarde" "Bookman"
[6] "Courier" "Helvetica" "Helvetica-Narrow" "NewCenturySchoolbook" "Palatino"
[11] "Times" "URWGothic" "URWBookman" "NimbusMon" "NimbusSan"
[16] "URWHelvetica" "NimbusSanCond" "CenturySch" "URWPalladio" "NimbusRom"
[21] "URWTimes" "ArialMT" "Japan1" "Japan1HeiMin" "Japan1GothicBBB"
[26] "Japan1Ryumin" "Korea1" "Korea1deb" "CNS1" "GB1"
[31] ".Keyboard" "Andale Mono" "AppleMyungjo" "Arial Black" "Arial Narrow"
[36] "Arial Rounded MT Bold" "Arial Unicode MS" "Batang" "Bodoni Ornaments" "Bodoni 72 Smallcaps"
[41] "Bookshelf Symbol 7" "Calibri" "Cambria" "Cambria Math" "Candara"
[46] "Comic Sans MS" "Consolas" "Constantia" "Corbel" "Courier New"
[51] "Franklin Gothic Book" "Franklin Gothic Medium" "Gabriola" "Georgia" "Gill Sans MT"
[56] "Gulim" "Impact" "Khmer Sangam MN" "Lao Sangam MN" "Lucida Console"
[61] "Lucida Sans Unicode" "Luminari" "Marlett" "Meiryo" "Microsoft Yi Baiti"
[66] "Microsoft Himalaya" "Microsoft Sans Serif" "Microsoft Tai Le" "MingLiU_HKSCS-ExtB" "MingLiU_HKSCS"
[71] "MingLiU" "MingLiU-ExtB" "Mongolian Baiti" "MS Gothic" "MS Mincho"
[76] "MS PGothic" "MS PMincho" "MS Reference Sans Serif" "MS Reference Specialty" "Palatino Linotype"
[81] "Perpetua" "PMingLiU" "PMingLiU-ExtB" "SimHei" "SimSun"
[86] "SimSun-ExtB" "Tahoma" "Trattatello" "Trebuchet MS" "Tw Cen MT"
[91] "Webdings"
我想在 R 中写入 pdf 文件时使用“Verdana”。
我正在使用以下命令为 pdf 指定字体
pdf("abc.pdf",height = 11, width = 8.5,family = "Helvetica")
我电脑上的字体包括 Verdana
fonts()
[66] "Trattatello" "Trebuchet MS" "Tw Cen MT" "Verdana" "Webdings"
[71] "Wingdings" "Wingdings 2" "Wingdings 3"
解决方案
问题是因为 R 的安装检测到 Verdana Bold/Italic 的重复字体,并且当我load_fonts()
从 extrafonts 包运行时跳过将 Verdana 添加到 pdffonts
所以我从我的电脑中删除了所有 Verdana 字体并重新安装了它们。然后按照自述文件中的步骤获取 extrafonts 包并解决了问题
推荐阅读
- nativescript - 具有多个项目模板切换可见性的 Nativescript 列表视图
- python - 如何创建基于 CSV 文件的字典
- matlab - 将数据集中的所有最小值提取到矩阵中
- r - 如何根据 R 中具有模式和序列的行添加新列?
- javascript - 当我在布尔值中添加一个切换时,我的函数停止工作。为什么?
- javascript - 提交带有错误消息的按钮,然后重定向位置
- c# - 获取 IIS 服务器目录路径
- c - 函数安全实践中的getline
- javascript - 即使我单击其子级或父级内的任何其他位置,如何在我的 React 组件中选择可单击的父级
- python - 将 python sqlalchemy 查询转换为 SQL