I recently upgraded to 0.9.5 (then 0.9.6) and have noticed a problem with SVG charts that I'm embedding into a PDF using FOP.
It seems the SVG text is being rendered into shapes. This wasn't the case in 0.9.4 and its making the PDF size much larger as well as the text quality very poor.
I actually use cewolf and have posted on that mailing list as well but at first glace it looks like that code is correct.
OutputStreamWriter writer =
new OutputStreamWriter(baos, "UTF-8");
DOMImplementation domImpl =
GenericDOMImplementation.getDOMImplementation();
Document document =
domImpl.createDocument("cewolf-svg", "svg", null);
SVGGeneratorContext ctx =
SVGGeneratorContext.createDefault(document);
ctx.setComment(
"Generated by Cewolf using JFreeChart and Apache Batik SVG Generator");
SVGGraphics2D svgGenerator = new SVGGraphics2D(ctx, false);
svgGenerator.setSVGCanvasSize(
new Dimension(cd.getWidth(), cd.getHeight()));
JFreeChart chart = (JFreeChart) cd.getChart();
chart.draw(
svgGenerator,
new Rectangle2D.Double(0, 0, cd.getWidth(), cd.getHeight()),
null);
svgGenerator.stream(writer, false);
writer.close();
Notice the constructor for SVGGraphics2D sets the text to shape flag to 'false'.
Did anything change between 0.9.4 -> 0.9.5 that could be causing this?
Thanks,
Tim
SVG text in 0.9.5+
Re: SVG text in 0.9.5+
I think the 'workaround' in the drawRotatedString(...) method in the RefineryUtilities class was re-instated. Try reverting to the original and see if that solves the problem. That workaround is also causing different problems on Mac OS X, so it will probably get removed (again) in the next release.
Regards,
Dave Gilbert
Regards,
Dave Gilbert