首页 > 解决方案 > 如何在 ggplot2 中使用 Adob​​e Creative Cloud 字体

问题描述

我有 Adob​​e Creative Cloud 并激活了几种字体。我确认它们在其他应用程序(例如 MS Word、Adobe Illustrator 等)中出现和工作。但是,我无法让 Adob​​e Font 与 ggplot2 一起使用。

通常,在我安装新字体(例如,来自 Google 字体)之后,我可以运行extrafont::font_import(),然后extrafont::loadfonts(),一切正常。Adobe 字体并非如此。当我运行extrafont::fonts()没有列出任何 Adob​​e 字体时,我从 ggplot2 收到一个错误,在使用非 Adob​​e 字体时我没有收到:

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 中使用 Adob​​e Creative Cloud 字体?

标签: rggplot2fontsadobeadobe-cc

解决方案


推荐阅读