[Xr] about Xr design

Owen Taylor otaylor at redhat.com
Tue Apr 22 20:08:43 PDT 2003

On Tue, 2003-04-22 at 21:25, Davor Buvinic wrote:
> Newbie question:
> I just started to play with Xr and I note that the library works with pixel 
> metrics (with the possibility to scale with XrScale).
> My question is: why not device independent metrics, as in PostScript?. The 
> README file asserts that the API is based on the PostScript operators, so why 
> not include also the device independent metrics?
> Of course I know its possible to work with device independent metrics if I 
> know the resolution at which I will display and some work with XrScale. The 
> question is simply about a matter of design of Xr.

I can't really answer this in full (not being involved in that part of
the design process), but what I would point out is that screen
resolutions are still low enough that it matters where you are with
respect to the pixel grid. 

If you want to draw a 1 pixel wide vertical line, you want to draw it so
it occupies one pixel, not half of two pixels.

This is quite important for say rendering a widget toolkit; less
important for rendering something like a vector illustration program.

For this reason, a scale of 1 == 1 pixel is in my opinion a useful 
default scale. It's also simply easy to understand... if you are 
doing graphics programming, pixel sizes will inevitably be involved.
Having to translate those into physical sizes would just be annoying
in a lot of case.

The Macintosh used 1 pixel == 1 point for a long time; and there was an
idea that this was a "physical" correspondence but that's not really
tenable with today's displays.


More information about the cairo mailing list