SVG that renders differently in Inkscape and Firefox

Bug #1086126 reported by David Mathog
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

The attached dump.svg is the output of a preliminary version of my text reassembler. The red text (underneath the black)
represents the original chunks of text read from the EMF file emitted by Inkscape. There is a rectangle drawn around each text record that was present in that EMF, and one big one around the completely reassembled paragraph. The black text is the reassembled text - in one big editable paragraph.

In Inkscape it is very good - the black text is aligned with the red (to the accuracy limit imposed by the EMF representation). However, in all other SVG viewers examined (Firefox, Opera, on Windows and Linux) the black text does not exactly line up with the red when there are two text sources on a line. This is evidently because these browsers are rendering the first piece of text on the line wider than inkscape does - if you open any of them you will see that the first bounding box does not fully surround the text that starts the line. The second chunk of text on the line, in order to be editable in Inkscape, uses a "dx" offset, and if the rendering comes up with a different width than Inkscape does for the preceding text, then the 2nd and later pieces are offset.

The example uses a common font and no especially tricky formatting. (0K and 500K refer to horizontal kerning in the original
file before it was saved to EMF.)

Any thoughts on how the font rendering in those browsers might be different from that in Inkscape?

Tags: renderer win32
Revision history for this message
David Mathog (mathog) wrote :
Revision history for this message
David Mathog (mathog) wrote :

Here is another example of the problem. In this one the boxes around the first part of the text were drawn manually in inkscape.
In each case the text starts just to the left of the leading period, and ends at the right edge of the last "A". Again, as with the previous case, when viewed in Firefox the text extends beyond the edges of the box. This is quite disturbing because near as I can tell all units are in Pixels, and the font Arial is common, suggesting that Firefox (and the other browsers tested) are doing something quite different with text scaling/kerning/fonts than is Inkscape. I suppose this could be a font substitution issue, something else for Arial, in the browser, but do not see how to tell if that is the case.

Revision history for this message
David Mathog (mathog) wrote :

Cross reference to same bug filed in Firefox:

https://bugzilla.mozilla.org/show_bug.cgi?id=818236

Revision history for this message
nightrow (jb-benoit) wrote :

Trying it on win7 and inkscape 0.48-2, rendering is the same (tried the 2 files).
What is your inkscape version and OS ?

Revision history for this message
David Mathog (mathog) wrote :

r11710, on both Linux and Windows. Trying 0.48-2...

You are right, with 0.48.2 both examples look the same as Firefox, with the text extending outside of the red bounding box (which is what you saw too, correct?)

Revision history for this message
su_v (suv-lp) wrote :

> You are right, with 0.48.2 both examples look the same as Firefox

Inkscape 0.48.2 on OS X (both the official prebuilt binary package (32bit) as well as a fresh local build (64bit)) renders the files exactly like 0.48.3.1 and current trunk - this difference must be due to changes in the win32 package (devlibs (?)), not in Inkscape's actual code base.

Revision history for this message
David Mathog (mathog) wrote :

In the interests of being as clear as possible, the attachment "classification.png" shows screenshots of the two display types "FIT" and "UNFIT" for the file "ink_fire_test_manual_boxes.svg". "FIT" is when the boxes are drawn exactly around the intended text, "UNFIT" has the text extending beyond the boxes.

Here are my test results:

FIT
Windows XP , inkscape r11367(<devlibs 32)
Windows XP, inkscape r11679 (devlibs 36)
Ubuntu 10.04 X11 to cygwin X11, inkscape r11367
Ubuntu 10.04 X11 to cygwin X11, inkscape r9886 (0.48.3.1 Ubuntu package)
Ubuntu 10.04 X11 to cUbuntu 10.04 X11 , inkscape r9886 (0.48.3.1 Ubuntu package)
Ubuntu 10.04 X11 to cygwin X11, inkscape r11679
Ubuntu 10.04 X11 to Ubuntu 10.04 X11 , inkscape r11679

UNFIT
All platforms, Firefox 16
Windows XP, Opera 12.02
Windows 7 64bit, Internet Explorer 9
Windows XP Inkscape 0.48.2 r9819 (distribution)

That is, the only version of inkscape that looks like the browsers is the one distribution. There may be a devlibs component to this, but that does not explain what I am seeing on Linux.

Revision history for this message
David Mathog (mathog) wrote :

This is the same test example remade with Inkscape 0.48.2 release (Windows) by reading in the previous version, resizing the rectangles to just fit the text, and saving. When viewed in Firefox it is closer to the inkscape view than was the previously posted example - but the bounding rectangles are still not exactly around the text. When viewed with the current version of branch lp988601 (should be equivalent to trunk in this behavior - it differs only in having extra EMF input/output functionality) the bounding boxes are not exactly around the text, just like the reverse was true with the previous example.

xxdiff (a side by side diff) of the two SVG files shows that the text parts are identical, but the rectangles are not, in particular, their widths are not. That suggests some change in the relative positioning of text with respect to graphics between these two Inkscape versions, and between them and Firefox.

jazzynico (jazzynico)
tags: added: renderer win32
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.