[cairo] Text output under angle - uneven text

cu cairouser at yahoo.com
Mon Feb 1 19:29:48 PST 2010


Good day all,

 I am seeing a strange issue with text output. When I apply rotation
matrix to text before output, I find that letters in a sentence are not
properly aligned - that is to say, they seem to be drawn higher/lower
relative to each other if the angle is not completely horizontal (or
vertical). What's more - they seem to oscillate up/down as the angle
changes. I.e. if I want to rotate text around, it will not stay as one
line, but rather appear as letters that slightly "dance" as the text is
rotated. It's not a major bug, but it does not look good, the result is
somewhat "unprofessionaly" looking - in contrast to the rest of the
graphics.

The code that does it is very basic:

cairo_matrix_init_translate(&mnew, x, y);
cairo_matrix_rotate(&mnew, angle);
cairo_set_matrix(cr, &mnew);
cairo_move_to(cr, -0.5 * txSize.width, -0.5 * txSize.height);
cairo_show_text(cr, tbuf);

Cairo version is either 1.8.x or 1.9.2, under Mac, Windows or Linux -
the result looks the same.

Any help in resolving this would be appreciated!
-Mike


More information about the cairo mailing list