[cairo] Fixing cairo_show_text to advance the current point

Carl Worth cworth at redhat.com
Tue Aug 23 17:30:51 PDT 2005

On Tue, 23 Aug 2005 20:12:10 -0400, Owen Taylor wrote:
> On Tue, 2005-08-23 at 16:46 -0700, Carl Worth wrote:
> Well, if it was three months ago, I'd be arguing that both the
> Cairo and Pango APIs should ignore the current point and take
> coordinates as input....

Yeah, well...

The imperfections will help us stay humble and make us stronger.

> I think some people will use both, and the Pango APIs *are* modelled
> after the Cairo APIs but the fact that show_layout() shows an entire
> paragraph should reduce the similarity enough that people are
> unlikely to get into too much trouble. 

That was my take here, that since pango gets involved in multi-line
layout, the advance-the-current-point-forward thing is not really
needed, and therefore not likely to be missed.

> I meant with respect to show_glyphs(), mostly. I think the difference
> there does need to be mentioned.

Ah, yes. But I see that as quite consistent. Again, like pango's
show_layout(), cairo's show_glyphs() can accept a lot more than a few
characters in a row, so I think it's distinct enough to warrant the
difference. (Not to mention that show_glyphs() has all glyphs manually
placed, so it's not even using the current point, nor would the user
benefit much from cairo advancing the point).

I think the convenience is worth it. And I'm not sure that everything
would be all that different if we had caught this back in February
with the API Shakeup. (We did put an explicit position in for
set_source_surface but setting the source is quite a different beast
from a drawing operator like show_text for which its quite legitimate
to examine the current point.)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050823/d849f269/attachment-0001.pgp

More information about the cairo mailing list