Skip to content
Prev 76347 / 398502 Next

pdf font embedding --- again

Hi

I think there are two problems:

(i)  You are specifying the font incorrectly.  Try ...

# You might need to specify full paths to these
afmfiles <- c("lbr.afm", "lbd.afm", "lbi.afm", "lbdi.afm", "lbms.afm");
# Set up the mapping for "lucida" font family
postscriptFonts(lucida=postscriptFont("Lucida", metrics=afmfiles))
# Specify that the "lucida" font is to be used
postscript(file="test.ps", family="lucida");
l<- 40:80;
plot(l,l,pch=l);
dev.off();

Should work for pdf() too.

This should put a reference to the appropriate font in the PostScript or 
  PDF file that R creates.

(ii)  R does not embed font information.  But you can, for example, use 
ghostscript to do it, as long as you tell ghostscript about the font 
too.  You might have to set up a file 'FontMap' which looks something 
like ...

/Lucida   (PATH_TO/lb___.pfb);

... (assuming that lb___.pfb is the name of the .pfb file for the Lucida 
font).  Then try something like (NOTE that you have to specify 
GS_FONTPATH to tell ghostscript where your FontMap file is) ...

GS_FONTPATH=PATH_TO_FontMap gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite 
-sPAPERSIZE=a4 -sOutputFile=testembed.pdf test.pdf

This should give you a file with the font info embedded and then you 
should be able to include that in a LaTeX document.

Paul

p.s. Thanks for the segfault report.  I will look at why that is happening.
ivo_welch-rstat8303 at mailblocks.com wrote: