final DOMImplementation impl = GenericDOMImplementation.getDOMImplementation();
final String namespaceURI = SVGConstants.SVG_NAMESPACE_URI;
final Document domFactory = impl.createDocument(namespaceURI, "svg", null);
final SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(domFactory);
ctx.setEmbeddedFontsOn(true);
final GraphicContextDefaults defaults = new GraphicContextDefaults();
defaults.setFont(new Font("Arial", Font.PLAIN, 12));
ctx.setGraphicContextDefaults(defaults);
ctx.setPrecision(12);
final SVGGraphics2D g2d = new SVGGraphics2D(ctx, false);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_DEFAULT);