I'm responding to myself here. After further experimenting, I both
fixed a bug (use getBeginIndex()) and found a simplification (create
the font with all attributes in one step) for my JasperReports/Leopard
hack.
In net.sf.jasperreports.engine.export.TextRenderer#renderParagraph (
AttributedCharacterIterator allParagraphs,
int lastParagraphStart, String lastParagraphText)
I replaced
draw(layout);
with
// I am trying to fix printing problems under Leopard,
// where fonts get not set properly.
// I am checking the OS Version, maybe I should check
// the JRE release instead.
// This has to be amended when the bug in whatever
// library has been corrected.
// Hopefully I have covered all malfunctioning system versions.
if (System.getProperty("os.name").equals("Mac OS X") &&
System.getProperty("os.version").startsWith("10.5"))
{
paragraph.setIndex(paragraph.getBeginIndex());
grx.setFont(Font.getFont(paragraph.getAttributes()));
}
draw(layout);
This is faster (getFont uses the systems font cache), simpler, does
not disturb other correct working systems and works, contrary to my
previous hack.
But why this is necessary at all I still don't know.
Regards,
Bernd
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden