[R] Graphical output format

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri May 15 10:01:08 CEST 2009

On Fri, 15 May 2009, Dieter Menne wrote:

> Stats Wolf <stats.wolf <at> gmail.com> writes:
>> Postscript, however, does not have to be what I need for two reasons.
>> First, it does not accept some special characters from foreign
>> languages (exactly like PDF).

'foreign' is a relative term which is imprecise (and somewhat 
impolite) when writing to an international community: I don't suppose 
Dieter Menne regards German characters as 'foreign' but Ei-ji Nakama 
does, unlike Japanese ones.

> You should given an example for that in pdf. I always had the impression
> that pdf is the most comprehensive in foreign character support.

Not really true, but since you can embed bitmaps in both PostScript 
and PDF, there are workarounds.

PostScript and PDF use 8-bit encodings for character strings except 
for some predefined encodings for CJK languages, so in principle this 
is far less comprehensive than windows() and X11() which use Unicode. 
However, in practice the limitations are the glyphs available in the 
specified fonts, and in all the cases I am aware of an available font 
can be encoded in one or two 8-bit encodings (and hence in one or two 
R font families).  You can't mix (say) Russian and Polish characters 
in a single text() call for pdf() (you can for windows()), but you can 
have them in separate calls for the same plot.

There are (on suitable R platforms) cairo_pdf() and cairo_ps() 
devices.  They are (on suitably rich OSes) able to cover a very wide 
range of characters, which they do by embedding the font gyphs into 
the output (often as bitmaps): the quality of the effect often depends 
on the output device used, which is why the traditional approach in 
PS/PDF is to render fonts in the output device.

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-help mailing list