From ripley at stats.ox.ac.uk  Mon Feb 12 09:24:35 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon, 12 Feb 2007 08:24:35 +0000 (GMT)
Subject: [Rd] Graphics driver test script?
In-Reply-To: <7098abec0702120008k71d67fe0r717fdf2557060aaf@mail.gmail.com>
References: <93c3eada0702111337i349d3fb5v8cad9777bcbb2714@mail.gmail.com>
	<7098abec0702120008k71d67fe0r717fdf2557060aaf@mail.gmail.com>
Message-ID: <Pine.LNX.4.64.0702120815410.391@gannet.stats.ox.ac.uk>

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



[Rd] Graphics driver test script?
Prof Brian Ripley