[Cairo] Text APIs round 2

Carl Worth cworth at east.isi.edu
Fri Aug 15 10:53:52 PDT 2003


On Aug 15, Keith Packard wrote:
 > But, PostScript doesn't have to deal with bitmap fonts.  I need to know 
 > the pixel size before I can select anything in that case.  I guess
 > I just need to keep the font parameters around and reselect a font if the 
 > transformation changes.

Is there a reason this wouldn't be feasible? It seems it would be
quite simple to allow cheap manipulation of font parameters and only
select an actual font just before drawing.

There are already a handful of other transformation-dependent objects
in Cairo that are currently being regenerated with every drawing, (the
polygonal pen, the composed matrices for images and patterns,
etc.). I'd already planned on coming up with a cheap way to detect
transformation changes so that these objects could be cached reliably.

 > Hmm.  How about I resolve the font the first time it's used and
 > never re-resolve it; that way I can have 'squishy' fonts that are
 > 'solidified' as late as possible, but then never again.  Change the
 > transformation a second time and you get garbage for bitmap fonts.
 > I can certainly live with that.

While I can live with that, I prefer to limit the number of ways that
Cairo provides for drawing guaranteed garbage.

At least the current proposal doesn't doesn't modify the API for the
benefit of bitmap fonts, (unlike the previous fonts-cannot-be-scaled
idea). And if someone really cares about bitmap fonts, then there's
room for them to do the work to make them look as good as possible.

-Carl




More information about the cairo mailing list