Last modified: 2008-03-24 21:01:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 13486 - Three bugs confirmed in SVG rendering of svg text elements - font sizing given in % or em is not being converted to px, and text underline fails
Three bugs confirmed in SVG rendering of svg text elements - font sizing give...
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2008-03-23 11:41 UTC by FT2
Modified: 2008-03-24 21:01 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Screenshot - opera 9 + IE6 (166.82 KB, image/png)
2008-03-24 03:46 UTC, FT2
Screenshot of the same images as rendered by mediawiki (223.16 KB, image/png)
2008-03-24 04:03 UTC, FT2

Description FT2 2008-03-23 11:41:55 UTC
Compare the thumbnail and the full image (un-thumbnailed) of:

The actual SVG file is hand-checked and tested in several browsers; it's normal and should be fine.

I don't know if this is the same as any other SVG render bugs and many of them are old, so I'm giving it a new bug ref for now.
Comment 1 FT2 2008-03-23 17:12:18 UTC
Although the browser renders the SVG file correctly, its inclusion _whether full size or thumbnailed_ on a wiki page is broken as above.
Comment 2 FT2 2008-03-23 17:50:42 UTC
Tested further. Its not related to being a "large SVG" either. has half the linear dimensions, 380 x 615. Identical error.
Comment 3 Daniel Friesen 2008-03-24 03:31:01 UTC
Eh? Correctly? What are these "several browsers"... In Firefox 2, I get this:

And even in Inkscape I get this:

So, while the issue isn't black blocks. The SVG clearly is not normal.
I would chalk this up to differences in SVG rendering engines. Cause not all SVG engines render a SVG the same. A SVG file should at least be correct before any rendering issue be considered a 'bug'.

Besides, MediaWiki doesn't even render SVG files, it offloads that to a separate svg program which is set in configuration, so to fix a svg 'bug', you'd have to fix every engine which it breaks in, which is something MediaWiki has no control over, because svg rendering engines are created by other projects not connected with MW.
Comment 4 FT2 2008-03-24 03:46:55 UTC
Created attachment 4751 [details]
Screenshot - opera 9 + IE6
Comment 5 FT2 2008-03-24 03:51:21 UTC
The SVG renders correctly in Opera, and Internet Explorer. Those are the two I have to hand. See above screenshot. (And note the slight differences in blurring of fonts, otherwise the two render them identically.)

I also hand-checked the xml within it a second time and it's as best I can tell, standards compliant. I don't have firefox so I can't test on that, but both of those two it renders fine. 
Comment 6 FT2 2008-03-24 04:03:58 UTC
Created attachment 4752 [details]
Screenshot of the same images as rendered by mediawiki
Comment 7 FT2 2008-03-24 04:05:25 UTC
And above, as these display within mediawiki pages.
Comment 8 FT2 2008-03-24 19:35:51 UTC

According to a graphics specialist:

"The problem was that in some places the font size was being scaled to 120% of the original size, but ImageMagick (MediaWiki's rendering engine) was interpreting this as a literal 120 point (I think) - the black boxes were actually letters. I've fixed that, and partially fixed the problem with the overlayed text when it's rendered with Gecko, e.g. in Firefox; the problem there was that it wasn't recognising the 'dy="1.4em"' in the tspan elements, but a simple change of units to pixels fixed that. There are still some strange things going on with Gecko, but I'm not sure what to do with those."
Comment 9 FT2 2008-03-24 19:39:48 UTC
So we have two apparent bugs identified in rendering SVG's:

**  Font sizing via percentage is broken somehow: sizing of the form font-size = "120%" is being rendered as "120px"

**  Line separation in SVG text elements of the form dy='1.4em' is broken somehow.
Comment 11 FT2 2008-03-24 19:54:24 UTC

Looking at the svg the issue seems to be that alternative size scales are not being correctly converted to pixels in svg rendering. 

Thus 120% of a 14px fontsize is rendered as 120px rather than 16.8px (=14px x 120%), whereas if the font-size=120% is replaced by font-size=16.8px it's fine. Likewise dy=2em fails whereas its equivalent dy=28px (=14px x 2) succeeds.

Failure to render underlined text is a separate issue.
Comment 12 Brion Vibber 2008-03-24 20:09:46 UTC
Please list bugs individually; there's no way we can reasonably track three or more different things on one bug entry.

Please also check for duplicates; there are plenty of SVG-related issues filed already.

Please also note that we use rsvg, not ImageMagick, as the rendering backend.
Comment 13 FT2 2008-03-24 21:01:06 UTC
Thanks Brion! Bugs opened:

Bug 13494 - font size and conversion to px.
Bug 13495 - underline not rendering properly.

I checked for duplicates. 40+ bugs are open mentioning SVG, but I can't find clear reference to these in them.

I guess this one can now be closed if all's ok?

Note You need to log in before you can comment on or make changes to this bug.