Skip to content
Prev 78755 / 398502 Next

greek symbols using pch

This is now well off the topic of the subject line, but I am afraid some 
misinformation has been propagated (and that is the `bug').

There _are_ bugs in the code shown: the postscript fonts support 32:255, 
not 1:256, and pch:0:31 are not taken from the font.  It seems an 
uninformed modification of the code in ?postscript.


What locale are you in?  That's something bug.report() gives and the 
posting guide asks for (because it often matters).

The code given works (albeit with warnings) in an 8-bit locale, but it 
often will not work in a multi-byte locale. In particular it does not work 
in a UTF-8 locale for a postcript() device.

The help page for points() does point out clearly

      In a multi-byte locale
      such as UTF-8, numeric values of \code{pch} greater than or equal to
      32 specify a Unicode code point.

Thus in UTF-8, pch=167 should be interpreted as a Unicode code point, and 
that is not a Greek symbol.

The problem for postscript() (and X11()) is that the standard font=5 is 
not encoded in the locale's encoding but Adobe Symbol, so supplying 
Unicode characters is unsupported.

I think R is working as documented here, but the piece of documentation 
about font=5 is in a different place (it is driver-specific).

Internationalization support for the postscript() driver is work in 
progress (more features will appear in 2.3.0), but at present all you can 
expect to work in a UTF-8 locale are ISO Latin-1 characters, and symbols 
via plotmath.

(I am aware of a few things that are not quite right in the Unicode 
support: some are being fixed for 2.3.0.)
On Tue, 11 Oct 2005, ecatchpole wrote: