[cairo] _cairo_lround (and effects on positioning of text)

Carl Worth cworth at cworth.org
Tue Nov 21 17:58:33 PST 2006


On Tue, 21 Nov 2006 17:37:02 -0800, Carl Worth wrote:
> I suppose it's "only" text that's going to be affected by this,

I did just verify that the patch only introduces _cairo_lround to
glyph-related function, (at least for supported backends---there is
also one case of _cairo_lround in _cairo_directfb_surface_composite
which I haven't looked at closely yet).

> So, do we care that this patch might move some text around by a pixel
> compared to where it was drawn before?

Phrased another way, how do we want to document the behavior of the
values passed to cairo_show_glyphs? We're accepting floating-point
values, but then rounding them. Do we really want to specify banker's
rounding for this? That feels so wrong.

Maybe we really should have just provided an integer-only API for
positioning text glyphs. (If so, one option would be to document that
the API really should be used with only integers for now, and that the
rounding mode is undefined for any non-integer value.) I'd at least
feel more comfortable specifying undefined rounding behavior than
banker's rounding for this.

-Carl
-------------- 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/20061121/191086c5/attachment-0001.pgp


More information about the cairo mailing list