[cairo] Font interface problem

Carl Worth cworth at east.isi.edu
Wed Mar 24 07:27:55 PST 2004


On Mar 9, Maarten Breddels wrote:
 > >  > Ok, it's not a big issue, but to keep things simple, i think it's
 > >  > better to just draw them the 'normal' way.
 > > 
 > > Could you describe more specifically what you would like to change
 > > here?
 > 
 > Well, to use a convention that sounds simple, so if y goes down, the
 > fonts should also be upside down(y going down). Or have (0,0) at the
 > lower left corner, and make y go up, and fonts upright.

It's not easy to do the right thing here by the principle of least
surprise. Computer graphics (including image formats) has a strong
tradition of placing the origin at the upper-left corner. Digital
typography (including font formats) has a strong tradition of placing
the origin at the lower left corner.

Cairo is trying to provide a consistent interface for targeting both
fields, but user expectations may be influenced by experience in one
field or the other.

The current implementation tries to be consistent with both
conventional origins simultaneously. Would it be more consistent or
less surprising to stick to an upper-left origin everywhere, even for
text? I don't know.

My inclination is to wait until we get plenty of feedback from users
of the text interface. I'm sure they'll let us know what they
hate. (And thanks Maarten for letting us know already).

 > And, do you agree that fonts drawn with:
 >   cairo_scale(2,2)
 >   cairo_scale_font(2)
 > Are '4' (whatever units) high, but it's a font of height 2, linearly
 > scaled 2 times in x in y.
 > While:
 >   cairo_scale(1,1)
 >   cairo_scale_font(4)
 > Is a font of height 4, and isn't scaled.

No, I don't agree. As Keith and Bill have already described, the
final transformation matrix should always have the same result,
regardless of what intermediate matrices and scale factor were used to
compute it.

-Carl




More information about the cairo mailing list