https://issues.apache.org/bugzilla/show_bug.cgi?id=50100

--- Comment #2 from Helder Magalhães <[email protected]> 2010-10-17 
04:59:08 EDT ---
(In reply to comment #0)
> I generated some an SVG document using the SVGGraphics2D Java class. I first
> displayed the document in Safari which showed everything as expected, with the
> text in the right size. Trying the same in Firefox 3.6 and Opera 10.63 on 
> MacOS
> X resulted in the text being the wrong size. 
> 
> Looking at the source of the generated document I noticed that the font-size
> has no unit:
> 
> <g style="font-family:&apos;Arial&apos;; font-size:10;">

I can confirm this. Firefox is strict-compliant to the SVG specification by
ignoring the (invalid) CSS declaration when no units are provided.

I remind that font-size is valid without units when used as XML attribute, so
toggling the SVG generator to use XML attributes instead of CSS style
declarations can help. I don't have a pointer handy to the relevant
documentation on how to do this, nor I've checked that it is even possible with
SVGGraphics2D, but take a look at "useCss" in the SVG generator documentation
[1]. ;-)


> Changing the style by hand to include the unit resolves the font size issue in
> both Firefox and Opera:
> 
> <g style="font-family:&apos;Arial&apos;; font-size:10px;">

Right, that may be a current (but ugly) workaround for things to work while
this is being worked on. Another, more elegant IMO, would be to set the already
stated "useCss" to false when generating SVG. If you try it, please confirm
that it works as a workaround.


At last but not least, please consider attaching a reduced (as simple as it can
get) test case in order for anyone to be able to reproduce the issue. (For
example, as I'm not familiar with SVGGraphics2D, I'm not even able to reproduce
this without a big time investment.)


[1] http://xmlgraphics.apache.org/batik/using/svg-generator.html

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to