Page MenuHomePhabricator

bad kerning of SVG rendering of diacritical marks as unicode characters
Open, MediumPublic

Description

Hello guys,

I noticed that SVGs with text having unicode characters of the combining diacritical marks block aren't rendered well on Wikimedia Commons into PNG when the with of the rendered image doesn't fit to the specified with of the SVG. Take for example File:SVG with combining diacritical marks as unicode characters (test image).svg Rendered in its specified width looks fine (link to rendered PNG):

SVG_with_combining_diacritical_marks_as_unicode_characters_(test_image).svg.png (130×516 px, 10 KB)

But the accents doesn't fit to the x character when the rendered PNG image width doesn't match the SVG width. Take for example the png image with 2000px width:

2000 SVG_with_combining_diacritical_marks_as_unicode_characters_(test_image).svg.png (504×2 px, 61 KB)

As you can see, the accents are moved to the right (by the way the accents are moved more to the right the bigger the gap in the width is). For smaller PNGs the accents are moved to the left (image with 250px width):

250 SVG_with_combining_diacritical_marks_as_unicode_characters_(test_image).svg.png (63×250 px, 2 KB)

I have created File:SVG with combining diacritical marks as unicode characters (test image).svg for this bug report. So feel free to play with this file, upload new versions and delete the file after this bug is resolved :-)

By the way: I came across this bug after uploading File:Illustration of differential quotient 7.svg and similar images which use the x tilde character.


Duplicate of T36947 & T205776
Reported Upstream: https://gitlab.gnome.org/GNOME/librsvg/-/issues/730 ; fixed in librsvg 2.51.2 and 2.50.6

Event Timeline

JoKalliauer renamed this task from PNG rendering of SVG on Wikimedia Commons with combining diacritical marks as unicode characters to bad kerning of SVG-Rendering of diacritical marks as unicode characters.May 9 2021, 3:52 PM

The issue has a regression before librsvg 2.51 for https://commons.wikimedia.org/wiki/File:T142908.svg , imho duplicate of T36947

svgCommonslibrsvg 2.50librsvg 2.51resvginkscapebatik
file
T142908.svg.png (130×516 px, 5 KB)
SVG_with_combining_diacritical_marks_as_unicode_characters_test_imageCusCOS_0p_librsvg.png (130×516 px, 11 KB)
SVG_with_combining_diacritical_marks_as_unicode_characters_test_imageCusCOS_0p_librsvg251.png (130×516 px, 11 KB)
SVG_with_combining_diacritical_marks_as_unicode_characters_test_imageCusCOS_0p_rendersvg.png (130×516 px, 17 KB)
SVG_with_combining_diacritical_marks_as_unicode_characters_test_imageCusCOS_0p_Inkscape.png (130×516 px, 17 KB)
SVG_with_combining_diacritical_marks_as_unicode_characters_test_imageCusCOS_0p_batik.png (130×516 px, 15 KB)
Aklapper renamed this task from bad kerning of SVG-Rendering of diacritical marks as unicode characters to bad kerning of SVG rendering of diacritical marks as unicode characters.May 10 2021, 9:36 AM
JoKalliauer updated the task description. (Show Details)
JoKalliauer moved this task from Backlog to Reported Upstream on the Upstream board.

"Incorrect text spacing when transform is not 1:1" will be fixed in librsvg 2.51.2 (and librsvg 2.50.6, once backported) according to https://gitlab.gnome.org/GNOME/librsvg/-/issues/730 (thanks to JoKalliauer for investigation and upstreaming).