[R] Set system font in R package Cairo in Mac OS X

Sverre Stausland stausland.johnsen at iln.uio.no
Sun Nov 10 15:30:50 CET 2013


Because of the issue raised in
https://stat.ethz.ch/pipermail/r-help/2013-November/362896.html, I am
switching to R on Mac OS X (10.6.8) to create some plots. Using
CairoPDF(), however, the commands I use in Windows (7) to select my
fonts don't have any effect on Mac OS X, where the output .pdf file
always has the Helvetica font.

library(package = "Cairo")
CairoPDF("test.pdf")
plot.new()
text(x=.5,y=.5,labels="\u0260",family="Times New Roman")
dev.off()

The outputs are attached. The Times New Roman font is exactly the same
on both systems. I'm using R 3.0.2 on both systems.

Sverre
-------------- next part --------------
A non-text attachment was scrubbed...
Name: windows.png
Type: image/png
Size: 896 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20131110/bd0c8ae7/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mac.png
Type: image/png
Size: 1028 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20131110/bd0c8ae7/attachment-0001.png>


More information about the R-help mailing list