= AffineTransform.getScaleInstance(scale, -scale);
// create a shape node that represents the d attribute
String d = glyphElement.getAttributeNS(null, SVG_D_ATTRIBUTE);
if (d.length() != 0) {
ShapeNode shapeNode = new ShapeNode();
AWTPathProducer app = new AWTPathProducer();
app.setWindingRule(CSSUtilities.convertFillRule(glyphElement));
try {
PathParser pathParser = new PathParser();
pathParser.setPathHandler(app);
pathParser.parse(new StringReader(d));
} catch (ParseException ex) {
throw new BridgeException(glyphElement,
ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object [] {SVG_D_ATTRIBUTE});
} finally {
// transform the shape into the correct coord system
Shape shape = app.getShape();
Shape transformedShape
= scaleTransform.createTransformedShape(shape);
shapeNode.setShape(transformedShape);
// set up the painter for the d part of the glyph
ShapePainter painter = PaintServer.convertFillAndStroke(
textElement, shapeNode, ctx);
shapeNode.setShapePainter(painter);
glyphContentNode.add(shapeNode);
}
}