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 Tom Diamond <th...@inf.uth.gr> on 2003/08/31 22:15:41 UTC

setSVGDOcument() does not work

Hello,

I do the following : I create a Document on the fly (create Elements, 
adding Attributes, setting childs etc., etc.). If I try to display it in 
a JSVGCanvas via the setSVGDocument() method I get the following exception :
------ begin ------
org.apache.batik.bridge.BridgeException: null:-1
An I/O error occured while processing the URI '' specified on the 
element <font-face-uri>
	at org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown 
Source)
	at org.apache.batik.bridge.SVGFontUtilities.findFontElement(Unknown Source)
	at org.apache.batik.bridge.SVGFontUtilities.getFontFamily(Unknown Source)
	at org.apache.batik.bridge.SVGTextElementBridge.getAttributeMap(Unknown 
Source)
	at 
org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(Unknown 
Source)
	at 
org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(Unknown 
Source)
	at 
org.apache.batik.bridge.SVGTextElementBridge.computeLayoutedText(Unknown 
Source)
	at 
org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown 
Source)
	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
	at org.apache.batik.swing.svg.GVTTreeBuilder.run(Unknown Source)
------ end -------

The URI in question is created by 
"fontFaceUriElement.setAttributeNS(null, "xlink:href", 
defaultFontPath);" where `defaultFontPath ` is the _absolute_ path to an 
external svg file (containing a font).
If I save the document first and then try to display it via the setURI() 
method, everything works just fine.
Any ideas?

I downloaded batik (http://xml.apache.org/batik/dist/) just a couple of 
days ago, so I assume it is the last stable version. I work on Linux and 
JDK 1.4.2 (SUN)

Tnx,

Tom.

-- 
Klein bottle for sale... inquire within.


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


Re: setSVGDOcument() does not work

Posted by Thomas DeWeese <Th...@Kodak.com>.
Tom Diamond wrote:
> Hello,
> 
> I do the following : I create a Document on the fly (create Elements, 
> adding Attributes, setting childs etc., etc.). If I try to display it in 
> a JSVGCanvas via the setSVGDocument() method I get the following 
> exception :
> [...]
> The URI in question is created by 
> "fontFaceUriElement.setAttributeNS(null, "xlink:href", 
> defaultFontPath);" 

    This is a FAQ, please read it from the Batik web site.
You need to provide the xlink namespace here instead of 'null'.

> where `defaultFontPath ` is the _absolute_ path to an 
> external svg file (containing a font).
> If I save the document first and then try to display it via the setURI() 
> method, everything works just fine.
> Any ideas?
> 
> I downloaded batik (http://xml.apache.org/batik/dist/) just a couple of 
> days ago, so I assume it is the last stable version. I work on Linux and 
> JDK 1.4.2 (SUN)
> 
> Tnx,
> 
> Tom.
> 




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