xfig device (was [Rd] Re: [R] MetaPost device?)
Prof Brian D Ripley
Sat, 8 Apr 2000 08:05:26 +0100 (BST)
On Sat, 8 Apr 2000, Ross Ihaka wrote:
> On Fri, Apr 07, 2000 at 10:53:35AM -0400, Thomas J Vogels wrote:
> > Ross Ihaka <firstname.lastname@example.org> writes:
> > > On Thu, Apr 06, 2000 at 06:29:08PM +0200, Guido Masarotto wrote:
> > >
> > > > The problem with MetaPost (if I understand well) is how
> > > > you do get metric information about the fonts.
> > >
> > > The metric info problem is what stoped me writing the XFig driver.
> > > Which metrics do you use for Times-Roman for example -- the X11 metrics
> > > or the PostScript metrics?
> > I'll be sorry for this naive question, but if you limited the fonts
> > in the FIG output to LaTeX fonts, couldn't you use the LaTeX font
> > information? (This doesn't solve the problem that what you see in an
> > X11 device is not what you get with dev.print which may or may not be
> > a good thing.)
> This is supposing that you can get get access to it. I certainly don't
> know enough about TeX to be able to parse tfm files. If code existed to
> compute the dimensions of strings then we'd be away.
AFAIR no problem: many dvixx drivers such as dvips compute string widths at
least. In dvips bbox.c computes the bounding box for a dvi file, and
thereby computes BB info for each string. In doing so it computes from the
tfm the llx,lly,urx,ury for each character.
However, I would be inclined to go the other way, and just use the
PostScript fonts and their metrics. For a start, the X11 metrics are I
believe device-specific, and I would view xfig screen output as an
approximation to the final printed form. And it is that final form I want
to be accurate.
> Another problem the text output by TeX can be rather richly structured
> -- kerning and glue come to mind.
Are we not just discussing a xfig driver for R, and R's driver model only
writes single text strings at specified (x,y) locations? So test output
from an R xfig driver would not be richly structured? Yes, there is
kerning but there is using postscript fonts directly, surely?
By the time a dvixx driver is reading the dvi file the kerning has been
done, but the information is all there in the tfm, and the format is
readily available (e.g. in tftopl).
Brian D. Ripley, email@example.com
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 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
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: firstname.lastname@example.org