[cairo] Banker's rounding problems and Nautilus

Behdad Esfahbod behdad at behdad.org
Tue Dec 5 11:14:12 PST 2006


On Fri, 2006-12-01 at 20:35 -0500, Carl Worth wrote:
> On Wed, 29 Nov 2006 18:24:14 -0800, "Daniel Amelang" wrote:
> > > Oh, and I've also gotten feedback about a pretty bad text positioning
> > > bug for the text nautilus is drawing on the background window. I think
> > > that's a problem from the new banker's rounding, but I'll bring that
> > > up in a new thread.
> 
> So the bug has already been reported with a nice screenshot here:
> 
> 	Update to cairo-1.3.4 worsen font rendering
> 	https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=217819
> 
> The problem with bankers' rounding being used during text positioning
> is that it's not invariant under translation. So when the text is
> drawn once in black, and then once again with an offset in white, (for
> the drop-shadow effect), it is getting rounded differently.
> 
> Meanwhile, within a single word, you can see "extra space" being
> inserted between letters, (as if one is getting rounded left while the
> next is getting rounded right). I had understood Behdad to say that a
> pango-using application would be using only integer metrics, so I am a
> bit surprised to see this problem.

So yeah, my bad previously.  Seems like in None and Slight hinting modes
in gnome-font-properties, you get non-integer metrics.

I was thinking about doing (cairo_double_to_fixed(x) + 32768) >> 16 or
something like that.

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





More information about the cairo mailing list