Search code examples
rggplot2fonts

How to implement Google Fonts in ggplot2 graphs?


Is there a way to directly access and implement free fonts (like Google Fonts) with R for graphs (ggplot2), without having them installed on my PC or Mac?


Solution

  • I think if I were you, I'd use this showtext package that seems to have a function that looks like this :

    library(showtext)
    font_add_google(name = "Amatic SC", family = "amatic-sc")
    

    I bet this could solve your problem

    You can maybe find more documentation on the package page directly (update --> link in the comment of your question, thanks Stefan) but I found all of this on this page

    https://www.r-bloggers.com/2019/03/adding-custom-fonts-to-ggplot-in-r/