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 Rob Davis-5 <te...@robertjdavis.co.uk> on 2008/03/13 20:10:03 UTC

Need to process negative width elements without causing Exception

How can I process Elements with "negative width" without getting an
Exception?

I'm processing a SVG file created from a commercial drawing program.

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


I'm getting
java.lang.IllegalArgumentException: negative width
exception
negative width

with stack trace back

GlyphLayout.java:1024>> getUnderlineShape()
GlyphLayout.java:436>> getDecorationOutline()
StrokingTextPainter.java:1191>> getDecorationOutline()
StrokingTextPainter.java:1036>> getOutline()
TextNode.java:281>> getOutline()
AbstractGraphicsNodeBridge.java:492>> getBBox()
SVGLocatableSupport.java:77>> getBBox()
SVGOMTextElement.java:135>> getBBox()
XyOutsideLabelGraphicsFilter.java:113>> acceptNode()
-- 
View this message in context: http://www.nabble.com/Need-to-process-negative-width-elements-without-causing-Exception-tp16036194p16036194.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: Need to process negative width elements without causing Exception

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


Cameron McCormack-4 wrote:
> 
> 
> Can you provide us with the file that causes the problem (or a reduced
> version that still exhibits it)?
> 
> 

Hi Helder and Cameron - thanks for responding.

Please find the problem file in this post - 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


Cameron McCormack-4 wrote:
> 
> 
> In general, though, Batik is quite intolerant of errors in SVG files.
> 
> 

Fair enough. I agree with the intolerance so that the standard is not
polluted.

However sadly I'm finding that tools like Corel do not comply. Now I don't
want to get into a debate about the merits of various drawing tools - I need
to work with this tool so have devised a partial solution which I need some
help with to complete.

The help I need is generic in that I need understanding of how to get batik
to update itself completely if a change is made to the SVG XML elements or
CSS.

When I say update itself completely I mean that the affected objects it has
created get updated as a result of these changes AND that outputted SVG XML
ALSO reflects these changes.

Naturally this needs to be done in the most efficient way possible rather
than having to re-render the whole document.

I would also say that actually batik is not tolerant at all, because as
you'll see from the exception path trace, the exception originates from
non-batik awt code that batik calls. 




-- 
View this message in context: http://www.nabble.com/Need-to-process-negative-width-elements-without-causing-Exception-tp16036194p16275095.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: Need to process negative width elements without causing Exception

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

Rob Davis:
> I'm processing a SVG file created from a commercial drawing program.
> 
> Inkscape draws this file OK without problems so why doesn't batik tolerate
> it?

Can you provide us with the file that causes the problem (or a reduced
version that still exhibits it)?

In general, though, Batik is quite intolerant of errors in SVG files.
That is the SVG 1.1 way — there must be a “highly perceivable error”
when coming across invalid content.  SVG Tiny 1.2 changes the way error
handling should be done so that many errors are effectively ignored in a
specific manner (e.g. an incorrect attribute value is treated is if the
attribute wasn’t specified).  In the future, Batik will probably move
towards this style of error processing, especially since it is more
consistent with how web browsers do things.

-- 
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