[R] Webdings font on pdf device
Steve Taylor
steve.taylor at aut.ac.nz
Tue Nov 4 02:41:06 CET 2014
Dear R-helpers
Has anyone successfully used the Webdings font on a pdf or postscript device?
I'm tearing my hair out trying to figure out how to make it work.
# It works on a png() device:
windowsFonts(Webdings = windowsFont("Webdings"))
png('Webdings.png', family = 'Webdings')
plot(-3:3,-3:3,type='n',xlab='',ylab='',axes=FALSE)
text (rnorm(26),rnorm(26),LETTERS,cex=2)
graphics.off()
I have tried to set up the Webdings font using the extrafont package but it gives warnings. The output file says it has Webdings in it, but the characters do not show.
R> library(extrafont)
Registering fonts with R
R> loadfonts(device = "pdf", quiet=TRUE)
R> pdf('Webdings.pdf', family='Webdings')
Warning messages:
1: In pdf("Webdings.pdf", family = "Webdings") :
unknown AFM entity encountered
2: In pdf("Webdings.pdf", family = "Webdings") :
unknown AFM entity encountered
3: In pdf("Webdings.pdf", family = "Webdings") :
unknown AFM entity encountered
4: In pdf("Webdings.pdf", family = "Webdings") :
unknown AFM entity encountered
R> plot(-3:3,-3:3,type='n',xlab='',ylab='',axes=FALSE)
R> text (rnorm(26),rnorm(26),LETTERS,cex=2)
There were 27 warnings (use warnings() to see them)
R> graphics.off()
R> warnings()[1]
Warning message:
In text.default(rnorm(26), rnorm(26), LETTERS, cex = 2) :
font width unknown for character 0x41
Any assistance would be much appreciated.
cheers,
Steve
More information about the R-help
mailing list