Page MenuHomePhabricator

Fonts are off in rasterized SVG images on wikimedia sites
Closed, ResolvedPublic


Author: avarab

Images like the one in the url component that are supposed to have the letter(s)
in them fit exactly to the image have those letters overflow the image, this is
probably a problem with the font(s) at Wikimedia sites as I've been been unable
to reproduce this with both rsvg 2.9.5 and 2.12.7 on my local install, rendering

Version: unspecified
Severity: normal
OS: Windows XP
Platform: PC



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:53 PM
bzimport set Reference to bz3769.
bzimport added a subscriber: Unknown Object (MLST).

avarab wrote:

The image in the URL component rendered on a local install with rsvg 2.12.7


and we have problem with cyrillic letters in rasterized SVG.

This is SVG with latin labels

Same figure with Russian translation: (black boxes)

The font rasterizer should have a better default font, and should also be able
to do the Serif vs Sans serif difference between font:
The text "Wiktionnaire" should be Serif and "/wik.sjɔ.nɛr/" is missing two

No difference after upgrading to 2.14.0.

shimmin wrote:


The subscript 3's are rendered huge. This image renders correctly in Inkscape,
or if opened in Mozilla, but the Mediawiki rasterizer is mangling it.

shimmin wrote:

(In reply to comment #5)


The subscript 3's are rendered huge. This image renders correctly in Inkscape,
or if opened in Mozilla, but the Mediawiki rasterizer is mangling it.

Diagnosis: font-size="75%" fails to be understood as 75% of the parent's size,
but instead appears to be taken as 75% of the canvas height! I'll fix this
particular image by specifying the font-size in point terms, but the parser
still needs to be fixed.

The problems of missing letters and the lack of serif fonts appear to be fixed.
The inconsistency in font sizes between rsvg and Inkscape remains. If the
handling of font-size="75%" really is incorrect in rsvg, it needs to be reported

I learned (painfully) that the rasterizer does not properly handle spacing in fonts. Specifically, it seems to treat multiple spaces as a single space in certain cases. The only workaround is to separate the spaced text into separate elements, which is awkward.

feroflo wrote:

In the same subject, there is a problem with the font "NSimSun" in this file: [] some Chinese characters had been changed from the file made with Inkscape 0.46.

*** Bug 19182 has been marked as a duplicate of this bug. ***

To add another image where this is very pronounced,

The image, if rendered at normal size is rendered perfectly: - actually the arrows are not rendered but this is a known rsvg bug.

However, if rendered at a reduced size, the text gets strange spaces at random places: - for example the text at bottom right that reads "Светлосна крива" becomes something like "Св ет лосн а кри".

I don't think this is a rsvg bug b/c on my computer rsvg (2.18.2) renders the image in reduced size just fine, and I don't see how it could be a MediaWiki bug. My guess is that this is caused by bad fonts installed on the servers.

Also very interesting: image history thumbnails.!Planetary_transit_sr.svg/120px-Planetary_transit_sr.svg.png is mangled, is just fine.

Assigning SVG bugs to Ariel -- need a cleanup pass to see what's fixed up by a librsvg upgrade, what can be resolved with fixes to our font configuration, what can be fixed on our end, and what still needs to be pushed upstream.

giving SVG bugs back to the pool.

The rethorical question mark issue seems fixed. There are still many other issues with fonts, some exhibit in some of the files reported here, but these effects all seem to have individual reports.