Page MenuHomePhabricator

SVG rendering may be "ignoring manual kerning" (TSpanElement attributes not fully supported)...
Closed, DuplicatePublic

Assigned To
None
Authored By
ShakespeareFan00
Feb 7 2016, 9:30 PM
Referenced Files
Restricted File
Jul 12 2022, 11:16 AM
Restricted File
Jul 12 2022, 11:16 AM

Description

After having some problems with text in SVG's I wondered if it might have something to do with the kerning/spacing.

Can someone checK that the render backend is correctly reading these:

https://www.w3.org/TR/SVG11/text.html#TSpanElementXAttribute
https://www.w3.org/TR/SVG11/text.html#TSpanElementDXAttribute

in respect of text and tspan.

Upstream: https://gitlab.gnome.org/GNOME/librsvg/issues/183

Event Timeline

ShakespeareFan00 raised the priority of this task from to Needs Triage.
ShakespeareFan00 updated the task description. (Show Details)
ShakespeareFan00 subscribed.

Compare the PNG rendering against the origibnal SVG in Firefox ....

https://commons.wikimedia.org/wiki/File:Kern_Test.svg

The top line has some kerning/rotation effects applied, the lower line is a plain comparison.

This explains why some EPS->SVG I'd been working on were breaking, the SVG rendering backend in use was ignoring or getting confused by the additional kerning data.

Hmm...

Thanks for taking the time to report this. Please provide exact steps to reproduce the problem, plus the expected outcome and the actual outcome.

The exact steps to reproduce are why I linked the sample SVG.

To reproduce the fault,: Produce an SVG where the <text> or <tspan> elements use the "dx", "x" or "orient" attributes (i.e manual kerning), with a multiple sequence of space separated values in the attributes mentioned. Also Generate a PNG at an appropriate dpi to compare against the Wikimedia rendering. Upload the test files to Commons (or other Mediawiki installation.)

My examples are :

SVG file :
https://commons.wikimedia.org/wiki/File:Kern_Test.svg

PNG reference image at 72 DPI:
https://commons.wikimedia.org/wiki/File:Kern_Test_%28PNG_reference_image%29.png

Expected behaviour: The SVG as displayed by Mediawiki/Wikimedia projects (as generated PNG) should be identical in form to the reference PNG image generated independently.

Actual behaviour :

On comparison the PNG rendered by Mediawiki/Wikimedia Commons does not render as per the reference PNG generated independently, the kerning and orientation effects being effectively ignored.

The relevant images:-

{F35315160}

{F35315159}

It was my understanding that the SVG handling had been updated. Is anyone able to cause it to regenerate the SVG thumbnails, renders for this?

Is anyone able to cause it to regenerate the SVG thumbnails

Anybody can, by purging the page.

And this is a normal purge (like with the Clock and purge gadget?) . I did that and I'm still seeing the concern as the rasterised thumbnail renders without the kerning when compared to the reference image.

Viewing the SVG file directly, gives the expected kerning and text modification.

(edited potion follows)

Given that this ticket was opened in 2016, I would have had a good faith expectation that the issue identified here, may have been addressed by an update in the back-end support.

I am also noticing on the larger scaled up rasters :
https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Kern_Test.svg/800px-Kern_Test.svg.png
https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Kern_Test.svg/1024px-Kern_Test.svg.png
https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Kern_Test.svg/1280px-Kern_Test.svg.png

The 'est Kern' portion of the lower text is drifting the left. (This is perhaps a different issue, and may need someone to examine the original SVG as well to make sure it's not a glitch in the original.)

I did that and I'm still seeing the concern as the rasterised thumbnail renders without the kerning when compared to the reference image.

You have not explained / linked yet to something that explains why you think that something should have changed.

ShakespeareFan00 renamed this task from SVG rendering may be "ignoring manual kerning"... to SVG rendering may be "ignoring manual kerning" (TSpanElement attirbutes not fully supported)....Jan 22 2018, 11:54 AM
ShakespeareFan00 renamed this task from SVG rendering may be "ignoring manual kerning" (TSpanElement attirbutes not fully supported)... to SVG rendering may be "ignoring manual kerning" (TSpanElement attributes not fully supported)....

Still not working, see the 3rd-version preview image of this plot -- the 4th version is the usual workaround.

@Rainald62: It is expected that it is still not working because this task has the status "open" and not "resolved". :)
If someone can reproduce this with librsvg locally and would like to file an upstream ticket with clear steps to reproduce (means: testcase), please go ahead: https://gitlab.gnome.org/GNOME/librsvg/issues/new/

@Aklapper: It's already there but quite new, GNOME/librsvg#183

Aklapper updated the task description. (Show Details)
Aklapper moved this task from Backlog to Reported Upstream on the Upstream board.

Ah, thanks for finding that!