Page MenuHomePhabricator

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

Description

I have been informed that SVN font rasterization has a problem with Persian text. The way https://commons.wikimedia.org/wiki/File:Stuxnet-influence.svg is rendered into a PNG, makes its text look different (in size and shape) from the SVG itself: https://upload.wikimedia.org/wikipedia/commons/4/4d/Stuxnet-influence.svg


Version: wmf-deployment
Severity: normal

Details

Reference
bz43640

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).
Huji created this task.Jan 4 2013, 6:22 PM

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?

Huji added a comment.Jan 4 2013, 9:39 PM

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.

Attached:

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

You can use one of the fonts that are listed at http://meta.wikimedia.org/wiki/SVG_fonts 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.

Huji added a comment.Jan 5 2013, 1:02 AM

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: https://test.wikipedia.org/wiki/File:Stuxnet-influence.svg


tl;dr:
*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.

Restricted Application added a project: I18n. · View Herald TranscriptJun 2 2015, 2:20 PM
Ebraminio moved this task from Backlog to Graphics on the RTL board.Aug 9 2015, 11:26 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 9 2015, 11:26 AM
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 https://upload.wikimedia.org/wikipedia/commons/4/4d/Stuxnet-influence.svg and opened it in Inkscape. Inkscape said "Font 'arial' substituted with 'Liberation Sans'". But then Inkscape rendered the text inside the box.

Huji closed this task as Declined.Mar 8 2016, 9:45 PM

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