[cairo] Improving PDF output

Bill Spitzak spitzak at d2.com
Mon Jan 8 11:49:41 PST 2007

Whether or not the text can be done this way, I think *every* cairo api 
should have the possibility of being done directly by the back end. This 
seems to be coming up more and more often and rather than adding things 
at random, why not do them all?

The backend api should be almost exactly the same as the api to cairo_t. 
The only difference is that there are a few more low-level operations 
(perhaps to directly get/set pixels and other code in the current 
backend) that are not part of the cairo api. The backend has a dispatch 
table for every cairo function, but if it does not define one of the 
api's it can put a zero in that entry in the table, and some kind of 
init function then changes those zeros to point at code in the cairo 

It is true that if the backend can replace "lineto" it must also replace 
almost everything about constructing and using paths. Don't worry about 
this, the fact that the table could be filled in this way does not mean 
such a backend can be allowed.

Baz wrote:
> On 07/01/07, Alp Toker <alp at atoker.com> wrote:
>>    BT
>>    /CairoFont-0-0 1 Tf
>>    10.72 0 -0 -10.72 120.032 972.133333 Tm
>>    (Version) Tj
>>    ET
> It strikes me that this would be unneccessary and a lot more efficient
> if cairo_show_text(), cairo_text_extents() had the possibility of
> dropping into the font backend, instead of always splitting text to
> glyphs first. There's the same issue on quartz/atsui, the common case
> of just displaying text (rather than warping glyphs) has direct
> support in the underlying API.
> The PS, PDF backends should translate cairo_show_text into something
> just like what you did there. If the caller has got hold of the glyphs
> for themselves its likely they were warping/kerning or otherwise
> messing with the spacing and your checks would be less likely to work.
> Is there a reason why there's no fast path like this? (apart from
> there being no patch for it yet :) )
> Cheers,
> Baz
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo

More information about the cairo mailing list