[R-SIG-Mac] Font Families and Cairo

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Oct 20 06:05:47 CEST 2011

On Wed, 19 Oct 2011, Fong Chun Chan wrote:

> Hi,
> I've been searching around the web and I found this thread which discusses
> exactly the same problem that I am facing when using Cairo on my Mac.  When

Oh you are using a Mac!  You failed to say that in
(and you are still not giving the 'at a minimum' information required 
in the posting guide).

> I use the following code:
> library(Cairo)
> Cairo(file='cairo_created', type='pdf', dpi=100)
> plot(1:10)
> dev.off()
> This produces a pdf with the text italicized.  The same code but using pdf()
> as the graphics device:
> pdf(file='pdf_created.pdf')
> plot(1:10)
> dev.off()
> Creates a text without italics.  According to Simon, a work around could be
> achieved by doing the following:
> CairoFonts("Arial:style
> =Regular","Arial:style=Bold","Arial:style=Italic","Helvetica","Symbol")
> But from my understanding this just replaces the Helvetica font with the
> Arial font.  Is there a solution that works if I still want to use
> Helvetica?

Well, you already told us one: use pdf().

You could also use R's built-in cairo_pdf() device (which has some bug 
fixes not in the Cairo package).

> Thanks,
> Fong
> 	[[alternative HTML version deleted]]

It also asked you not to send HTML.

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-SIG-Mac mailing list