Page MenuHomePhabricator

SVG to PNG: font rendering problem in Persian
Closed, DeclinedPublic


I have been informed that SVN font rasterization has a problem with Persian text. The way is rendered into a PNG, makes its text look different (in size and shape) from the SVG itself:

Version: wmf-deployment
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:21 AM
bzimport set Reference to bz43640.
bzimport added a subscriber: Unknown Object (MLST).

This is a bit strange.

I looked at it in both Chrome and Firefox on Fedora, and the PNG was surprisingly *better* than SVG. Most notably, the last line in the legend box was shown properly inside the box in PNG, but it overlapped the box in SVG.

Except that, however, I see that the Persian letters are rendered pretty much the same in both images. I may be missing something, however.

Can you please post a PNG of how it is supposed to look?

Created attachment 11590
Comparison of SVG rendered on Wiki (top) and SVG itself (bottom)

Well, I'm confused. For me on Mac and Windows (Firefox, Chrome and Safari), it is the Wiki's version which is worse, with the last line of legends overlapping the box.

I'm attaching a file which compares the two. It is not about which font is more beautiful (to be honest, I like the wiki's font better). It is about the layout being broken, compared to the original.


Maybe the Wikimedia server doesn't have the font that you are using.

You can use one of the fonts that are listed at or ask to install your font; see Bug 13716 for an example.

To be installed, the font must have a free license. It's also strongly recommended to ask to install a font that has an Ubuntu package.

Bug 43648 was created accordingly. Once that is fixed, you can close this one as WORKSFORME; I will let the user know to recreate the SVG file using one of the fonts installed through Bug 43648.

The fonts were already installed, as of at least June 2012, so prior to this bug being filed. The glyphs in the legend look quite a bit different viewing the svg in firefox vs our png - however I don't even know which one is correct as I don't speak farsi. However, the png thumb of the svg looks similar to [[File:Stuxnet-influence_chart.png]] as well as the text actually printed out on my computer, so I'm leaning towards our svg renderer being correct.

The svg you link as an example specifically declares the font to be arial. Changing it to one of the titr (one of the farsiweb fonts) makes things look bolder, but as far as I can tell, does not change what the glyph looks like:

*The font is already installed and has been for a long time
*Is the svg rendering still wrong?
**If it is, could you be specific about what you expect the lettering to look like, for those of us that don't speak farsi.

Aklapper lowered the priority of this task from Low to Lowest.Mar 8 2016, 7:57 PM
In T45640#494655, @Huji wrote:

Bug 43648 was created accordingly.

Bug 43468 = T45648 has been fixed in the meantime.

Once that is fixed, you can close this one as WORKSFORME; I will let the user know to recreate the SVG file using one of the fonts installed through Bug 43648.

@Huji: Has that happened?

I get the same results as in T45640#494629 here in Firefox. PNG thumbnails are rendered correctly (inside the box), SVG not.
I also downloaded and opened it in Inkscape. Inkscape said "Font 'arial' substituted with 'Liberation Sans'". But then Inkscape rendered the text inside the box.

No, but the issue is with the choice of fonts. Therefore I am closing this as declined. Thanks for the follow up.