r - 如何在 ggplot2 中使用 Adobe Creative Cloud 字体
问题描述
我有 Adobe Creative Cloud 并激活了几种字体。我确认它们在其他应用程序(例如 MS Word、Adobe Illustrator 等)中出现和工作。但是,我无法让 Adobe Font 与 ggplot2 一起使用。
通常,在我安装新字体(例如,来自 Google 字体)之后,我可以运行extrafont::font_import()
,然后extrafont::loadfonts()
,一切正常。Adobe 字体并非如此。当我运行extrafont::fonts()
没有列出任何 Adobe 字体时,我从 ggplot2 收到一个错误,在使用非 Adobe 字体时我没有收到:
library(tidyverse)
ggplot(mtcars, aes(x = disp, y = mpg)) +
geom_point() +
theme(axis.title = element_text(family = "Papyrus"))
ggplot(mtcars, aes(x = disp, y = mpg)) +
geom_point() +
theme(axis.title = element_text(family = "Museo"))
#> Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): no font could
#> be found for family "Museo"
#> Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : no
#> font could be found for family "Museo"
#> Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : polygon edge not found
由reprex 包(v0.3.0)于 2020 年 12 月 18 日创建
有没有办法在 ggplot2 中使用 Adobe Creative Cloud 字体?
解决方案
推荐阅读
- python - 使用 pyinstaller 创建的 python 可执行文件在 Windows 虚拟机中不起作用
- javascript - 全局范围在 Web 浏览器内运行的客户端 Javascript 中意味着什么
- reactjs - 如何使用 Jest 监视函数
- python - 如何使用 os.subprocess.run() 自动关闭等待键窗口?
- docker - 为什么 docker 只运行 1 个图像?
- postgresql - 在以前有效的配置中忽略 Postgres 数据库的 /docker-entrypoint-initdb.d 错误
- java - 如何将多种类型的树视图导出到文件中
- terraform - 在 Terraform 中创建 Azure SPN 密码结束日期(以小时为单位)
- javascript - 如何跟踪 webpack 模块分辨率?
- sql - SQLite - 添加列并使用另一个表更新它们