[R] Using Arial font in linux

Stephen Eglen eglen at pcg.wustl.edu
Fri Mar 14 22:44:02 CET 2003


Hi, 

Late last year there was a thread on r-help about installing Arial
fonts on linux machines:

  http://finzi.psych.upenn.edu/R/Rhelp02/archive/8548.html

I too would like to use Arial fonts in some R plots created on my
redhat machine.  I've installed the TrueType fonts from
http://corefonts.sourceforge.net/ -- there is now a directory 
/usr/share/fonts/msttcorefonts/ and xlsfonts reports many fonts:

% xlsfonts | grep arial 
...
-monotype-arial black-medium-r-normal--0-0-0-0-p-0-ascii-0
-monotype-arial black-medium-r-normal--0-0-0-0-p-0-fcd8859-15
-monotype-arial black-medium-r-normal--0-0-0-0-p-0-iso8859-1
...

How do I specify to use the Arial family within a call to
postscript()?  The following code didn't work ...   The thread
after the suggestion to vist corefonts.sourceforge.net stopped,
without saying how to then use the fonts within R.  Do I first need to
create .afm files so that I can use the second form of argument for family?


postscript(file="try.ps", horizontal=F,
           onefile=F,
           width=4, height=4,
           family="Arial",
           pointsize=12)
hist(rnorm(100))
dev.off()

Thanks for any pointers,
Stephen



More information about the R-help mailing list