I was able to import the font Lato in my shiny web app from google and to using it, but I want to change the font in my ggplot2 graphics into Lato too, but with the family argument it doesnt work, because ggplot want to access only windows fonts.
Here is my code:
library(shiny) library(shinyjs) library(dplyr) library(ggplot2) #library(showtext) ui <- shinyUI(fluidPage( tags$head(tags$style( HTML(' @import url("https://fonts.googleapis.com/css2?family=Lato:wght@300&display=swap"); #sidebar { background-color: white; } * { font-family: "Lato"; }') )), titlePanel("Hello Shiny!"), sidebarLayout( sidebarPanel(id="sidebar", sliderInput("bins", "Number of bins:", min = 1, max = 50, value = 30) ), mainPanel( plotOutput("distPlot") ) ) )) server <- shinyServer(function(input, output) { output$distPlot <- renderPlot({ x <- faithful[, 2] # Old Faithful Geyser data ggplot(data.frame(x), aes(x = x)) + geom_histogram( bins = 30) + labs(x = NULL, y = NULL, fill = NULL, title = "Title should be in Font Lato") + theme(plot.title = element_text(size=10, family = 'Lato')) }) }) shinyApp(ui=ui,server=server) Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : Zeichensatzfamilie in der Windows Zeichensatzdatenbank nicht gefunden
Any ideas why ggplot cannot find Lato?
Thanks

