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 Jan Tosovsky <j....@tiscali.cz> on 2011/02/21 22:40:33 UTC

Text on Path - startOffset range

Hello Everyone,

I am creating a wheel with labels on it (text on the path) but as text
outside the path is clipped, I must to render these cases twice (the second
time out of 0-100% range), see the attached test case. But it seems to be
not supported by Batik as Squiggle tools returns the following exception:

org.apache.batik.bridge.BridgeException: file:/D:/data.svg:24
The attribute "startOffset" of the element <textPath> is invalid
	at
org.apache.batik.bridge.SVGTextPathElementBridge.createTextPath(SVGTextPathE
lementBridge.java:132)
	at
org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(SVGT
extElementBridge.java:949)
	at
org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(SVGTextEl
ementBridge.java:856)
	at
org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(SVGTextEleme
ntBridge.java:636)
	at
org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(SVGTextElemen
tBridge.java:292)
	at
org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:224)
	at
org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
	at
org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219)
	at
org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
	at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)
	at
org.apache.batik.swing.svg.GVTTreeBuilder.run(GVTTreeBuilder.java:96)

Only Firefox 4.0beta or Opera renders it as expected. Is there any chance to
support this also in Batik? I have no idea what workaround to choose for
this... 

Regards,
Jan


Re: Text on Path - startOffset range

Posted by Cameron McCormack <ca...@mcc.id.au>.
Jan Tosovsky:
> It's me again. I've prepared more complex example and these
> startOffset ranges turned out to be still problematic (particularly
> with the text-anchor attribute set to the middle), see the attached
> example (December ember).
>
> The text anchor is shifted so that text is not centered at the
> specified point so both occurrences appear in different positions
> (they should match).

Unfortunately I don’t have time right now to look into the correctness
of this example to verify if it’s a bug.  I would suggest as a simple
workaround to define a second path that is just the top half arc of the
circle, and centre a single “December” string on it.  This seems better
than splitting the string across the endpoints of the circle path
anyway.

> Should I report it somewhere?

You can file bugs here:

  https://issues.apache.org/bugzilla/

Thanks,

Cameron

-- 
Cameron McCormack ≝ http://mcc.id.au/

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


RE: Text on Path - startOffset range

Posted by Jan Tosovsky <j....@tiscali.cz>.
It's me again. I've prepared more complex example and these startOffset ranges turned out to be still problematic (particularly with the text-anchor attribute set to the middle), see the attached example (December ember).

The text anchor is shifted so that text is not centered at the specified point so both occurrences appear in different positions (they should match).

Should I report it somewhere?

Regards,
Jan


> -----Original Message-----
> From: Jan Tosovsky [mailto:j.tosovsky@tiscali.cz]
> Sent: Tuesday, February 22, 2011 7:09 PM
> To: batik-users@xmlgraphics.apache.org
> Subject: RE: Text on Path - startOffset range
> 
> Wow, what amazing speed of implementing this!
> 
> I've already built it from sources and it works like a charm.
> Thanks a lot!
> 
> Regards,
> Jan
> 
> 
> > -----Original Message-----
> > From: Cameron McCormack [mailto:cam@mcc.id.au]
> > Sent: Tuesday, February 22, 2011 12:07 AM
> > To: batik-users@xmlgraphics.apache.org
> > Subject: Re: Text on Path - startOffset range
> >
> > Jan Tosovsky:
> > > I am creating a wheel with labels on it (text on the path) but as
> > text
> > > outside the path is clipped, I must to render these cases twice
> (the
> > second
> > > time out of 0-100% range), see the attached test case. But it seems
> > to be
> > > not supported by Batik as Squiggle tools returns the following
> > exception:
> > > …
> >
> > I think you are right.  I can’t find anything in the SVG spec that
> > disallows negative percentages.  This is fixed in SVN now (r1073181).
> >
> > --
> > Cameron McCormack ≝ http://mcc.id.au/
> >

RE: Text on Path - startOffset range

Posted by Jan Tosovsky <j....@tiscali.cz>.
Wow, what amazing speed of implementing this!

I've already built it from sources and it works like a charm.
Thanks a lot!

Regards,
Jan


> -----Original Message-----
> From: Cameron McCormack [mailto:cam@mcc.id.au]
> Sent: Tuesday, February 22, 2011 12:07 AM
> To: batik-users@xmlgraphics.apache.org
> Subject: Re: Text on Path - startOffset range
> 
> Jan Tosovsky:
> > I am creating a wheel with labels on it (text on the path) but as
> text
> > outside the path is clipped, I must to render these cases twice (the
> second
> > time out of 0-100% range), see the attached test case. But it seems
> to be
> > not supported by Batik as Squiggle tools returns the following
> exception:
> > …
> 
> I think you are right.  I can’t find anything in the SVG spec that
> disallows negative percentages.  This is fixed in SVN now (r1073181).
> 
> --
> Cameron McCormack ≝ http://mcc.id.au/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-
> help@xmlgraphics.apache.org


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


Re: Text on Path - startOffset range

Posted by Cameron McCormack <ca...@mcc.id.au>.
Jan Tosovsky:
> I am creating a wheel with labels on it (text on the path) but as text
> outside the path is clipped, I must to render these cases twice (the second
> time out of 0-100% range), see the attached test case. But it seems to be
> not supported by Batik as Squiggle tools returns the following exception:
> …

I think you are right.  I can’t find anything in the SVG spec that
disallows negative percentages.  This is fixed in SVN now (r1073181).

-- 
Cameron McCormack ≝ http://mcc.id.au/

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