[Rd] Re: [R] MetaPost device?

Guido Masarotto guido@sirio.stat.unipd.it
Thu, 6 Apr 2000 18:29:08 +0200

[moving to r-devel]

On Thu, Apr 06, 2000 at 05:35:57PM +0200, Peter Dalgaard BSA wrote:
> "Vidhyanath Rao" <rao.3@osu.edu> writes:
>
> > I would like to know if a MetaPost device is available or in the plans.
> > .....................................................................
> > If not, how easy/hard is it to add a new device to R? I caouln't see
> > ...................................................................
> It's not terribly hard (said the man who people have been nagging to
> do an xfig driver for years...) if you know the file format to
> generate. You need to figure out how to do do a rather small
> set of primitives to do text, polylines, etc., and then fill routines
> to do those into a fairly simple framework.

The problem with MetaPost (if I understand well) is how
you do get metric information about the fonts.
In particular for the plotmath stuff.
The easiest way is to delegate the whole thing to metapost itself (and
to TeX in the back), i.e., you use
> text(somewhere,"\sum_i x_i")
(not 'text(somewhere,expression(...))')
and on the mp file the device write
'btex $\sum_i x_i$ etex'
ie, you ask to MetaPost to call TeX to process the fragment.
However, this has the obvious drawback that the preview on the screen
is not good.
The alternative is to use the approach of the postscript device
(you fix the fonts available, distribute a set of files with metric
information of the fonts, and make the device to use it).
I am not sure about how hard this will be. BTW, which
kind of fonts is used by MetaPost?

guido
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._