Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement Google Fonts in ggplot2 graphs?

Tags:

r

fonts

ggplot2

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?

like image 853
Enrico Di Maio Avatar asked Jul 24 '26 02:07

Enrico Di Maio


1 Answers

The solution has changed a bit in these years. font_add_google() was moved to the sysfonts package. You also need to activate showtext.

To the beginning of your script or your Quarto file add:

sysfonts::font_add_google(name = "Amatic SC", family = "amatic-sc")
showtext::showtext_auto()
like image 79
Jakub Jędrusiak Avatar answered Jul 26 '26 19:07

Jakub Jędrusiak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!