国际米兰有
italic specimens on Google Fonts
,但你下载的国际米兰
showtext::font_add_google()
不会呈现为斜体。
举个例子
library(tidyverse)
library(showtext)
library(ggtext)
font_add_google("Inter")
font_add_google("Roboto")
t0 <- tibble(
x = 1,
y = 4:1,
lab = c(
"This is Roboto",
"<i>This is Roboto</i>",
"This is Inter",
"<i>This is Inter</i>"
)
)
showtext_auto()
t0 %>%
ggplot(
aes(
x, y, label = lab
)
) +
geom_richtext(
fill = "grey95",
family = "Roboto",
size = 10,
label.color = NA,
data = t0 %>%
filter(
lab %>%
str_detect("Roboto")
)
) +
geom_richtext(
fill = "grey95",
family = "Inter",
size = 10,
label.color = NA,
data = t0 %>%
filter(
lab %>%
str_detect("Inter")
)
)
正如你所看到的,Roboto用斜体渲染,但国际米兰没有。