// 'requiredFeatures', 'requiredExtensions' and 'systemLanguage'
if (!SVGUtilities.matchUserAgent(e, ctx.getUserAgent())) {
return null;
}
TextNode node = new TextNode();
// specify the text painter to use if one has been provided in the
// bridge context
if (ctx.getTextPainter() != null) {
node.setTextPainter(ctx.getTextPainter());
}
// 'transform'
String s = e.getAttributeNS(null, SVG_TRANSFORM_ATTRIBUTE);
if (s.length() != 0) {
node.setTransform
(SVGUtilities.convertTransform(e, SVG_TRANSFORM_ATTRIBUTE, s));
}
// 'visibility'
node.setVisible(CSSUtilities.convertVisibility(e));
// 'text-rendering' and 'color-rendering'
Map textHints = CSSUtilities.convertTextRendering(e);
Map colorHints = CSSUtilities.convertColorRendering(e);
if (textHints != null || colorHints != null) {
RenderingHints hints;
if (textHints == null) {
hints = new RenderingHints(colorHints);
} else if (colorHints == null) {
hints = new RenderingHints(textHints);
} else {
hints = new RenderingHints(textHints);
hints.putAll(colorHints);
}
node.setRenderingHints(hints);
}
UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, e);
// 'x' attribute - default is 0
s = e.getAttributeNS(null, SVG_X_ATTRIBUTE);
float x = 0;
if (s.length() != 0) {
StringTokenizer st = new StringTokenizer(s);
String startX = st.nextToken();
x = UnitProcessor.svgHorizontalCoordinateToUserSpace
(startX, SVG_X_ATTRIBUTE, uctx);
}
// 'y' attribute - default is 0
s = e.getAttributeNS(null, SVG_Y_ATTRIBUTE);
float y = 0;
if (s.length() != 0) {
StringTokenizer st = new StringTokenizer(s);
String startY = st.nextToken();
y = UnitProcessor.svgVerticalCoordinateToUserSpace
(startY, SVG_Y_ATTRIBUTE, uctx);
}
node.setLocation(new Point2D.Float(x, y));
return node;
}