Skip to content
Prev 180448 / 398513 Next

Graphical output format

On Fri, 15 May 2009, Dieter Menne wrote:

            
'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.
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.