Waffle & font family not found in Windows font database

雨燕双飞 提交于 2019-12-11 05:09:36

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/49482512/waffle-font-family-not-found-in-windows-font-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!