I installed the "extrafont" package to install the external Duality font library using the ttf_import () method. However, when specifying a font using the wordcloud method, I get the following error:
Installation command:
# Assuming the font file, DUALITY_.ttf, is in the working directory (see link to font above) font_import(".",FALSE,pattern="DUALITY")
Wordcloud Command:
wordcloud(ap.d$word, ap.d$freq, scale=c(8,2), min.freq=10, vfont=c("Duality","plain"), random.order=FALSE, rot.per=0, use.r.layout=FALSE, colors=pal2, fixed.asp=FALSE)
Output:
Error in strwidth(words[i], cex = size[i], ...) : invalid 'vfont' value [typeface -2147483648]
To make sure the font is really installed, I issued the following commands
> choose_font("Duality") [1] "Duality" > fonts() ....[49] "Waree" "Duality"
Why is the Duality font not showing up in the vfont parameter of wordcloud? And how to make it visible to Cairo (the default rendering tool). TIA!
source share