[R] Using Arial font in linux

Stephen Eglen eglen at pcg.wustl.edu
Sat Mar 15 02:22:48 CET 2003


 > How do I specify to use the Arial family within a call to
 > postscript()?  

To follow up on my previous message, in case others are interested,
this is what I did, which seems to work for me.
First, the .ttf files need converting to afm:

ttf2afm /usr/share/fonts/msttcorefonts/arial.ttf > ~/arial.afm
ttf2afm /usr/share/fonts/msttcorefonts/ariali.ttf > ~/ariali.afm
ttf2afm /usr/share/fonts/msttcorefonts/arialbd.ttf > ~/arialbd.afm
ttf2afm /usr/share/fonts/msttcorefonts/arialbi.ttf > ~/arialbi.afm

and then I did the following in R:

postscript(file="try.ps", horizontal=F,
           onefile=F,
           width=4, height=4,
           family=c("/home/stephen/arial.afm",
             "/home/stephen/arialbd.afm",
             "/home/stephen/ariali.afm",
             "/home/stephen/arialbi.afm"),
           pointsize=12)
hist(rnorm(100))
dev.off()

Stephen



More information about the R-help mailing list