[cairo] Fixing cairo_show_text to advance the current point

Owen Taylor otaylor at redhat.com
Tue Aug 23 16:39:13 PDT 2005


On Tue, 2005-08-23 at 15:38 -0700, 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.
> 
> This would be consistent with the behavior of the "show" operator in
> PostScript.
> 
> This allows a composite string to be displayed with multiple calls to
> cairo_show_text without the user ever needing to ask for any
> extents. This seems quite consistent with the "toy" use cases for
> cairo_show_text.
> 
> The attached patch implements this behavior along with a test case
> that shows how it can be used.
> 
> It is rather late in the game, (we're planning to release cairo 1.0
> today), for a semantic change like this, but cairo/BUGS has had the
> following since about forever:
> 
> 	cairo_show_text is not updating the current point by the
> 	string's advance values.
> 
> Any objections to this going in?

Hmm:

 - The Pango functions that show text are not going to be changed
   at this point. (show_layout, show_layout_line, 
   show_glyph_string)

 - Your patch doesn't change show_glyphs(), and I tend to agree
   with that.

So, the question is - is the gain in convenience for the toy API
worth the possible confusion and the need to document the 
inconsistency?

That would be my only question. Other than that the change seems
fine.

Regards,
						Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050823/43e6e2ed/attachment-0001.pgp


More information about the cairo mailing list