[Rd] Graphics driver test script?

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Feb 12 09:24:35 CET 2007

On Mon, 12 Feb 2007, Byron Ellis wrote:

> On 2/11/07, Geoff Russell <geoffrey.russell at gmail.com> wrote:
>> Hi,
>> 1. I started work on a metapost graphics driver a week or so ago and it is
>> gradually taking shape. I'm building up my own test cases into a
>> script as I go, but
>> figured you may have a "canonical testing script" of cases a driver must handle?
> I typically use demo(graphics) for initial development and then things
> like example(plotmath) to make sure I'm getting font encoding working
> properly.
>> 2. The clipping function looks like being a tricky problem. It seems
>> to me that the
>> callers of the driver assume that clipping affects all following calls
>> until the next
>> clipping call resets the clipping box.   With metapost, the clipping
>> function clips the
>> current graphics region and has no effect on following drawing functions.  I'm
>> not sure how to handle this --- the 2 models are very different.
> Sounds like you get to make a lot of clipping calls in metapost.

Or ask R to do the clipping.  The structure for a graphics device includes

     Rboolean canClip;           /* Hardware clipping */

R's clipping is not as sophisticated as is possible in some devices (e.g. 
it does not take line widths and joins into account AFAIR), but it is used 
by the XFig device, for example.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-devel mailing list