[R] pdf() device uses fonts to represent points - data alteration?

From: jiho <jo.irisson_at_gmail.com>
Date: Thu, 4 Oct 2007 10:21:28 +0200

Hello all,

I discovered that the pdf device uses fonts to represent "points" symbols (as in plot(...,type="p",...) ). Namely it uses ZapfDingbats with symbol U+25cf. This can lead to problems when the font is not available, or available in another version (such as points being replaced by other symbols, or worst: slightly displaced). Furthermore, it also causes problems when opening the pdf files for editing in other programs. I know that for reproducibility one should avoid doing this but there are cases where R is simply not suited to produce the end result graphic directly using code (Ex: replace some colors by CMYK versions for color consistency in print). In addition, publishers also often like being able to retouch graphics to ensure fonts consistency or such, and this will be destructive in the case of these pdfs. For example, Inkscape interprets points as squares (more like U+2751 in ZapfDingbats) and Adobe Illustrator does not even recognize the font (substituting AdobePiStd). I tried to embed fonts with embedFonts() but his does not solves the issue with editing (Inkscape produces a kind of star and AI still chokes on the font) and worst, it modifies how the original graphic renders in pdf viewers: the circles are now filled (I believe this is because this is the default state of the ZapfDingbats character).

So my questions are:
- does anyone have a work around this?

Examples of code:

	plot(0,0,xlab="",ylab="",bty="n",xaxt="n",yaxt="n"); grid(lty=1);

visualize the fonts:
	pdffonts test.pdf

and a package with the two pdf files and bitmaps of how they render or are interpreted in various programs:


Thank you in advance for your attention and help.



R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 04 Oct 2007 - 08:28:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 31 Oct 2007 - 11:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.