The only fonts supported by commonality.cloud
(as well as wordclouds) are the Hershey family fonts, which have the advantage that each character is described as a set of points (the vector fonts), and render this character means to join these points with a line. With this, we avoid the size problem (as there is no pixelization effect) and when plotting a rotated character the appearance gets better.
The following typefaces and fontindex are supported:
-
typeface: 'serif' | fontindex: {'plain', 'italic', 'bold', 'bold italic', 'cyrillic', 'oblique cyrillic', 'EUC'}
-
typeface: 'sans serif' | fontindex: {'plain', 'italic', 'bold', 'bold italic'}
-
typeface: 'script' | fontindex: {'plain', 'italic', 'bold'}
-
typeface: 'gothic english' | fontindex: {'plain'}
-
typeface: 'gothic german' | fontindex: {'plain'}
-
typeface: 'gothic italian' | fontindex: {'plain'}
-
typeface: 'serif symbol' | fontindex: {'plain', 'italic', 'bold'}
-
typeface: 'sans serif symbol' | fontindex: {'plain', 'italic'}
Example:
library(tm)
library(wordcloud)
data(SOTU)
corp <- SOTU
term.matrix <- TermDocumentMatrix(corp)
term.matrix <- as.matrix(term.matrix)
commonality.cloud(term.matrix,
colors = "black",
scale= c(32,4) ,
random.order=FALSE,
vfont=c("sans serif","plain"))
For more information, ?Hershey