You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Helder Magalhães <he...@gmail.com> on 2008/03/14 09:52:46 UTC

Negative font size breaks document rendering (was Need to process negative width elements without causing Exception)

>  Inkscape draws this file OK without problems so why doesn't batik tolerate
>  it?

Because it's invalid, although the specification isn't clear regarding
this. Seems to occur only in text elements.


Symptoms:
Running Batik Squiggle (through usual "javaw"), status bar shows
"Rendering document failed" error message.

Opening the document with a debug console (using "java" instead of "javaw") the
java.lang.IllegalArgumentException: negative width


Procedure:
1. Open attached test case.


Expected results:
A line is rendered.

Actual results:
Nothing is rendered. Sometimes, Squiggle interface freezes after
loading the document.
It's stated that «The document shall be rendered up to, but not
including, the first element which has an error» [1]
This is not the observed behavior, as the line previous to the
erroneous element should be rendered.


Additional notes:
The SVG specification states that:
«For SVG, if a <length> is provided without a unit identifier the SVG
user agent processes the <length> as a height value in the current
user coordinate system.» [2]
This suggests that the implementation, according to the exception,
seems to use width instead of height.

Although CSS specification states that «Negative lengths are illegal»
[3], it's suggested in length values that «If a negative length value
cannot be supported, it should be converted to the nearest value that
can be supported.» [4]


Environment:
Batik 1.7, JRE 1.6.0_03, Windows XP SP2 (although this seems a
platform-independent issue).


Regards,

  Helder Magalhães

[1] http://www.w3.org/TR/SVG/implnote.html#ErrorProcessing
[2] http://www.w3.org/TR/SVG/text.html#FontSizeProperty
[3] http://www.w3.org/TR/REC-CSS2/fonts.html#propdef-font-size
[4] http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-length

SOLUTION Re: Negative font size breaks document rendering (was Need to process negative width elements without causing Exception)

Posted by Rob Davis-5 <te...@robertjdavis.co.uk>.
See solution

http://www.nabble.com/Modifying-internal-CSS-in-SVG-document---partial-solution---need-help-with-batik-re-draw-update-to16275087.html#a16536682

This works.


Another solution would be to apply any Corel service pack patches to Corel
12. This might work. If it doesn't fix the problem then the above solution
is still worthwhile.
-- 
View this message in context: http://www.nabble.com/Negative-font-size-breaks-document-rendering-%28was-Need-to-process-negative-width-elements-without-causing-Exception%29-tp16046786p16536686.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Negative font size breaks document rendering (was Need to process negative width elements without causing Exception)

Posted by Rob Davis-5 <te...@robertjdavis.co.uk>.
Hi Helder and Cameron - thanks for responding.

I have a partial solution to my problem BUT need help with getting batik to
update/redraw/take into account my modifications - see my post:

http://www.nabble.com/Modifying-internal-CSS-in-SVG-document---partial-solution---need-help-with-batik-re-draw-update-to16275087.html

-- 
View this message in context: http://www.nabble.com/Negative-font-size-breaks-document-rendering-%28was-Need-to-process-negative-width-elements-without-causing-Exception%29-tp16046786p16275089.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Negative font size breaks document rendering (was Need to process negative width elements without causing Exception)

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Helder.

Helder Magalhães:
> Actual results:
> Nothing is rendered. Sometimes, Squiggle interface freezes after
> loading the document.
> It's stated that «The document shall be rendered up to, but not
> including, the first element which has an error» [1]
> This is not the observed behavior, as the line previous to the
> erroneous element should be rendered.

Yeah, Batik doesn’t really do the “rendered up to, but not including”
thing properly.

> Additional notes:
> The SVG specification states that:
> «For SVG, if a <length> is provided without a unit identifier the SVG
> user agent processes the <length> as a height value in the current
> user coordinate system.» [2]
> This suggests that the implementation, according to the exception,
> seems to use width instead of height.

I think the “width” referred to in the exception is something else.

> Although CSS specification states that «Negative lengths are illegal»
> [3], it's suggested in length values that «If a negative length value
> cannot be supported, it should be converted to the nearest value that
> can be supported.» [4]

My reading of that paragraph is that it applies to properties that
ordinarily should support negative lengths, but there is some
implementation specific restriction preventing it from being supported.

The text for 'font-size' in CSS2 says “Negative lengths are illegal”.

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org