Search code examples
rfontswaffle-chart

Waffle & font family not found in Windows font database


I am trying to get the folowing code to work so that it will display the glyph medkit or any other icons from the FontAwesome font inside my waffle plot.

library(waffle)
library(extrafont)

font_import()


loadfonts(device = "postscript")

which does display Registering font with R using postscriptFonts(): FontAwesome

parts <- c(`Un-breached\nUS Population`=(318-11-79), `Premera`=11, `Anthem`=79)

waffle(parts/10, rows=3, colors=c("#969696", "#1879bf", "#009bda"),
   use_glyph="medkit", size=8)

When I run waffle I get the following errors:

Warning messages:

1: Removed 3 rows containing missing values (geom_text).

2: In grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y,  :
font family not found in Windows font database

I just get a plot with boxes missing the icon inside them. What am I missing in my install of fontawesome or in my work inside RStudio?


Solution

  • So the classic have you unplugged it and plugged it back in approach worked...I restarted RStudio and now it works.