GNOME Bugzilla – Bug 587721
Aliasing bug in application of transformation matrix
Last modified: 2017-08-30 15:13:09 UTC
Please describe the problem: The following SVG file renders incorrectly, where glyphs overlap. Adjusting the font-size parameter to 12, and then changing the transformation matrix back to the identity produces the correct result, even though the transformation is mathematically similar, as far as I can tell. <?xml version="1.0" encoding="utf-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="1179.75118pt" height="687.74173pt" viewBox="0 0 1179.75118 687.74173" enable-background="new 0 0 1179.75118 687.74173" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <g font-family="'DejaVu Sans'" font-size="1" kerning="0" font-weight="400" fill="#000000"> <text transform="matrix(12 0 0 12 929.88438 660.96434)">Frenchtown</text> </g> </svg> Steps to reproduce: 1. Render the above svg 2. 3. Actual results: SVG output results in overlapping text Expected results: The SVG output should be identical either through application of a transfromation or by specifying the original font-size parameter. Does this happen every time? yes Other information:
The problem is that here: https://git.gnome.org/browse/librsvg/tree/rsvg-cairo-draw.c#n425 before calling pango_cairo_show_layout the docs suggest to call pango_cairo_update_layout. Sometimes it seems to work because the cairo matrix has not been changed after the layout was created.
Good catch, Massimo!!! This is what was making transformed text look weird. I've been annoyed by this for months. This is fixed in the librsvg-2.40 branch in commit bf717d5c6a521e53cd455f9a19b6761164715d28, and in the master branch in commit c70000117fb6e7dabdb77c1c8cc1067add7da6d9.