I would like to create a plot in R using dice font for values 1 to 6. Dice font for windows can be downloaded here - copy the downloaded true type font to the C:\Windows\Fonts directory and it can be used in windows applications like Excel or Word.
I found out about the showtext package in this question for adding fonts to R which seems to add the dice font using the R script below.
require(showtext)
font_add(family = "dice",regular = "C:/Users/Mark/AppData/Local/Microsoft/Windows/Fonts/dice.ttf")
For some reason, I don't understand I had to set the path to the AppData/Local directory to get font_add to no report a could-not-find-it error. The next challenge was to get was to make a simple test plot
plot(c(1,2),c(2,1),pch = 0, col = "blue", type = "p", cex =5)
text(c(1,2),c(2,1),c(2,1),col = "red")
However, when I attempt to use the dice font using the text funtion I get an error ...
font family not found in Windows font database
text(c(1,2),c(2,1),c(2,1),col = "red", family = "dice")
Questions:
- Is there a way to display the fonts accessible to R so I can determine if the dice font is available?
- If dice font is available then how do I get the font working with the text function?
- Is there an alternative or better way to approach this idea?