[cairo] ATSUI font rendering bug

Baz brian.ewins at gmail.com
Wed Dec 13 17:46:02 PST 2006


I've been scratching my head over the misrendering of text in the
ATSUI tests, specifically text-rotate (which shows 'cairo' in the
correct size in the top left quadrant, then suddenly shrinks & grows
it as you move round the bottom right).

I've tracked the bug down to this line in 'CreateSizedCopyOfStyle'
(cairo-atsui-font.c):

    Fixed theSize =
        FloatToFixed(CGSizeApplyAffineTransform
                     (CGSizeMake(1.0, 1.0), theTransform).height);

^^ this line is doing:
[width  ] = [a b][1]
[height]     [c d][1]

then using height as the font size. Surely what is meant here is
sqrt(width^2+height^2)? So the explanation for what's happening in the
top left of the test output is that the font size is actually being
set to negative values and being ignored.

Its too late at night for me to fix this one... just posting in case
anyone else is looking at atsui.

Also: any suggestions on how best to fix it? I'm not sure whether its
best just to put in the sqrt or just scale the glyphs elsewhere
(second way needs more thinking to code up but makes more sense
performance wise)

-Baz


More information about the cairo mailing list