[cairo] Fixing cairo_show_text to advance the current point

Peter Wang pwang at enthought.com
Tue Aug 23 16:15:24 PDT 2005

Carl Worth wrote:
> We've never actually written documentation for what cairo_show_text
> does, but I believe that in addition to displaying the provided text
> it should advance the current point according to the advance values of
> the extents of the given text.

FWIW, I think this is sort of the behavior in Apple's Quartz API.  They have 
the notion of a "text transform matrix" which is concatenated on to the main 
drawing CTM; thus, when you make repeated calls to show_text(), it updates the 
text transform matrix and saves the trouble of manually advancing the text 
position, but this doesn't affect the main graphics context's CTM.

As far as I can tell (and I am new to Cairo), this isn't the way Cairo's 
show_text() works, since it just grabs the current point via 

 > This would be consistent with the behavior of the "show" operator in
 > PostScript.

I'm not sure what the behavior of PostScript's show operator is, but PDF also 
has this notion of a text matrix distinct from the CTM.  (See 5.3 of the PDF 
v1.6 spec.)


More information about the cairo mailing list