[R] using LaTeX-fonts with R

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jan 15 15:26:14 CET 2008


On Tue, 15 Jan 2008, bert stumm wrote:

> Hi,
>
> I try to use the sfrm1000.pfb Type-1 font with my postscript plots. When I
> add family=CM to the postscript() command the output is empty. What am I
> doing wrong?
>
> # define font
> CM <- Type1Font('ComputerModern',                         # font ID
>    c(file.path(getwd(), c('sfrm1000.afm', '', '', ''))), # font metrics
>    encoding='AdobeStd');                                 # font encoding
>
> postscript('sin.ps', family=CM);
> dev.off();
>
> I have the two files sfrm1000.afm and sfrm1000.pfb. To my knowledge the
> Type-1 font is the pfb file, which I never gave explicitly.

Correct: the printer uses the font: R uses only the font meta-information.

> Furthermore I am
> confused by the fact that I have to give 4 afm files. (sfrm1000.afm and
> sfrm1000.pfb are from the latex cm-super package.)

For plain, italic, bold and bold italic faces.

> Futhermore if someone has a HOWTO on using LaTeX fonts with R, please provide
> a pointer.

See http://www.r-project.org/doc/Rnews/Rnews_2006-2.pdf

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list