[cairo] Re: Cairo font size should be in units

Bill Spitzak spitzak at d2.com
Thu Sep 30 17:52:29 PDT 2004

On Wednesday 29 September 2004 03:16 pm, Owen Taylor wrote:
> > I should point out that Graydon's description of the default CTM in
> > cairo is missing one important aspect. For display-devices[*], the
> > default CTM is computed by computing 1 unit == 1/96 inch, and then
> > rounding that to the nearest pixel size.
> I think I've characterized this in previous mail as a nasty suprise
> awaiting developers as soon as the first user's screen goes above
> the threshold for 2-pixels-per-unit.

If this is true then the threshold can be increased. I think it is now at 144 
DPI, but I believe it could be changed to as high as 184 DPI? It does not 
seem that anything in Cairo requires the rule for the default transform to be 
defined exactly. Thus if the suprise is "nasty" it can be avoided by changing 
the rules and nothing will break.

The current Cairo design matches what everybody wants for existing displays 
(integers produce integer numbers of pixels) and also makes it clear that 1 
unit can be larger than 1 pixel, which is certainly necessary for the future, 
even if the exact rules are not determined yet.

> > >  - Pixels matter at screen resolutions
>> > Absolutely. That's why we did the rounding described above. This way, by
> > default, integer user-space units map to integer numbers of device-space
> > pixels.
> But in the two-pixels-per-unit world, do people really only want
> 2 and 4 pixels, or do they also want 3 pixels?

Yes, but they could get 3 pixels by drawing 1.5 unit wide lines.

More information about the cairo mailing list