Page MenuHomePhabricator

PNG thumbnail of SVG image shows incorrect text positions when each letter has its own coordinates
Closed, DuplicatePublic

Description

Example https://commons.wikimedia.org/wiki/File:SVG_text_position_bug.svg

A bug is reproduced if each letter has its own coordinates.

Code sample.

<text
y="149.56369"
x="97.536133"
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222199px;font-family:Helvetica;-inkscape-font-specification:Helvetica;writing-mode:lr-tb;fill:#231f20;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775"
id="text11190">
<tspan
style="stroke-width:0.35277775"
x="97.536133 99.260513 99.887047 101.4562 103.02535 104.43646 105.22105 106.7902 107.57478 108.51458 109.29916 110.23895 111.80811 112.43465 113.06118"
y="149.56369"
sodipodi:role="line"
id="tspan11188">Flaps 0 (trail)</tspan>
</text>

If these coordinates are removed (in the sample it is “99.260513 99.887047 101.4562 103.02535 104.43646 105.22105 106.7902 107.57478 108.51458 109.29916 110.23895 111.80811 112.43465 113.06118"), it renders correctly.

In the preview on the upload page, this file is displayed correctly. https://commons.wikimedia.org/w/index.php?title=Special:Upload

Renderer in SVG check took
https://tools.wmflabs.org/svgcheck/index.php has same problems

Event Timeline

Leksey created this task.Jan 6 2019, 12:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 6 2019, 12:40 PM
Leksey updated the task description. (Show Details)Jan 6 2019, 1:12 PM

Hi @Leksey, thanks for taking the time to report this!

A bug is reproduced if each letter has its own coordinates.

Where and how to see the bug? What makes you think that there is a bug in librsvg? How is the SVG file shown for you, in which browser or application on which operating system?
Is this maybe about the PNG thumbnails instead and not the SVG file?

For the records, I do not see any incorrect rendering of the SVG file itself (at https://upload.wikimedia.org/wikipedia/commons/5/54/SVG_text_position_bug.svg ) when testing locally with inkscape-0.92.3 and librsvg2-2.44.11 (which is way newer than the librsvg2 on the Wikimedia servers, see T193352):


Opening the SVG file in Chromium 71 looks also correct, while Firefox 64 on Linux looks pretty bad.

Leksey added a comment.Jan 6 2019, 6:38 PM

Oh. Thanks for the quick response. Probably, I incorrectly used the term "rendering". I called rendering a rasterization process (SVG to PNG conversion to making preview). Is this an incorrect use of the term rendering?

To see the error, you must open the link https://commons.wikimedia.org/wiki/File:SVG_text_position_bug.svg and there will be an image https://upload.wikimedia.org/wikipedia/commons/thumb/5/54/SVG_text_position_bug.svg/86px-SVG_text_position_bug.svg.png

Leksey awarded a token.Jan 6 2019, 6:48 PM
Aklapper renamed this task from SVG render incorrect text positions to PNG thumbnail of SVG image shows incorrect text positions when ecah letter has its own coordinates.Jan 6 2019, 8:03 PM
Aklapper added a project: Thumbor.

Hmm, that's also one possible definition of rendering something. :) Thanks for the clarification!

TilmannR pointed out that this might be the same as T35245: Incorrect text positioning/kerning in SVG rendering (text/tspan x/y, dx/dy attribute; upstream) (though I'm a bit confused because SVG versus the PNG thumbnail of it)

Leksey renamed this task from PNG thumbnail of SVG image shows incorrect text positions when ecah letter has its own coordinates to PNG thumbnail of SVG image shows incorrect text positions when each letter has its own coordinates.Jan 14 2019, 8:46 PM