dejawho created BATIK-1218:
------------------------------
Summary: Style fill not correctly resolved
Key: BATIK-1218
URL: https://issues.apache.org/jira/browse/BATIK-1218
Project: Batik
Issue Type: Bug
Affects Versions: 1.9
Reporter: dejawho
Attachments: test conversione.svg
Hi,
I'm using batik to load the attached SVG. I load the document with:
String parser = XMLResourceDescriptor.getXMLParserClassName();
SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory( parser );
Document svgDocument= factory.createDocument( uri );
UserAgent userAgent = new UserAgentAdapter();
DocumentLoader loader = new DocumentLoader( userAgent );
BridgeContext bridgeContext = new BridgeContext( userAgent, loader );
bridgeContext.setDynamicState( BridgeContext.DYNAMIC );
// Enable CSS- and SVG-specific enhancements.
(new GVTBuilder()).build( bridgeContext, loadedDocument );
I iterate every node reading the attributes and I obtain the computed style
with:
CSSStyleDeclaration textNodeStyle =
((SVGSVGElement)svgDocument.getDocumentElement()).getComputedStyle(textNode,
null);
SVGPaint svgPaint = (SVGPaint) textNodeStyle .getPropertyCSSValue(attribute);
Doing this I'm able to find the correct style value for the style attribute.
But there is a case where the value is not resolved correctly.
On the attached SVG on line 471 it is defined a text with a style fill set to
white, inside it there is a tspan with the text. The tspan doesn't define any
style. When I try to resolve the fill on the computed style of the tspan node I
get the color as black.
The strange thing is this also happen if I take the computed style from the
text node, the fill will be returned alwys as black.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]