Hi:

This doesn't directly answer your question, but you may want to investigate
the tikzDevice package. From its DESCRIPTION file:

The TikZ device enables LaTeX-ready output from R graphics functions. This
is done by producing code that can be understood by the TikZ graphics
language. All text in a graphic output with the tikz() function will can be
typeset by LaTeX and therefore will match whatever fonts are currently used
in the document. This also means that LaTeX mathematics can be typeset
directly into labels and annotations! Graphics produced this way can also be
annotated with custom TikZ commands.

HTH,
Dennis

On Sat, Sep 11, 2010 at 4:18 AM, KARAVASILIS GEORGE <gkaravas@ee.duth.gr>wrote:

> Hello, R users.
> I am trying to embed Computer modern fonts to an R plot and I get the
> following error.
>
> CM <- Type1Font("CM",
> +                  c(paste("cm-lgc/fonts/afm/public/cm-lgc/",
> + c("fcmr8a.afm", "fcmb8a.afm", "fcmri8a.afm", "fcmbi8a.afm"), sep=""),
> + "./cmsyase.afm"))
> > pdf("cm.pdf", width=3, height=3, family="CM")
> > plot(1:length(y), y, xlab="ss", ylab=expression(x[2]))  ## for any vector
> y
> > dev.off()
> null device
>          1
> > embedFonts("cm.pdf", outfile="cmembed.pdf",
> fontpaths=c("cm-lgc/fonts/type1/public/cm-lgc", "."))
> Error in embedFonts("cm.pdf", outfile = "cmembed.pdf", fontpaths =
> c("cm-lgc/fonts/type1/public/cm-lgc",  :
>  status -1 in running command 'gswin32c.exe -dNOPAUSE -dBATCH -q
> -dAutoRotatePages=/None -sDEVICE=pdfwrite
> -sOutputFile=C:\DOCUME~1\user\LOCALS~1\Temp\RtmpccEtgV\Rembed28163716
> -sFONTPATH=cm-lgc/fonts/type1/public/cm-lgc;.  cm.pdf'
> In addition: Warning message:
> In system(cmd) : gswin32c.exe not found
>
>
> Operating system: Windows XP, SP2.
> cm-lgc has been unzipped in the working directory  "C:/Program
> Files/R/R-2.10.1" and the AFM, PFB files are also in same directory.
> Any help?
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]

