[Rd] Defining extra fonts in the postscript driver

Duncan Murdoch dmurdoch@pair.com
Sat, 14 Apr 2001 12:03:31 -0400


I've been looking at the ellipse package I co-wrote with Ed Chow for
S-Plus a few years ago, cleaning up the documentation now it's been
ported to R (by Jesus Frias, thanks IOsu!) and I'm back as the
maintainer.

One of the things it did which we thought was kind of cute at the time
was to use a few lines of Postscript code to define a font, where the
glyphs were ellipses of various shapes, used in the plotcorr function
to display big correlation matrices.

This isn't needed, strictly speaking:  the current port draws the
ellipses using polygon() and lines().  But drawing them with calls to
text() was quite a bit faster,  resulted in much smaller output files,
and just generally seemed like a good idea.

I can imagine other situations where people want to use strange fonts
(user-defined, or just imported from somewhere or other) in R graphs.

Right now that's quite difficult.  The Postscript driver supports four
fonts plus the symbol font; this limit is hard-coded into it.  I can
see a strong argument for having the first five fonts follow a
predictable pattern, but shouldn't it be possible to extend the list?
Syntax could be like the extended family syntax for the current
driver:  a list of filenames of AFM files defining the font
characteristics.  The documentation could state that the first five
must be for regular, bold, italic, bold italic and symbol fonts, but
there seems to be no requirement to restrict the list to 5 entries, or
to put any constraints on entries after the first 5.

I'd be happy to submit revised devPS.c and postscript.Rd files to
implement this, if there's general agreement that it would be a good
idea.

Duncan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._