It is possible to draw from one Graphics2D
to another Graphics2D
?
Let me explain.
I have printing issues, when i display a JTextArea
or JTextPanel
in screen, internaly its used sun.java2d.SunGraphics2D
, but when im printing its used sun.print.PeekGraphics
and sun.awt.windows.WPathGraphics
.
The problem is with some kind of Fonts, like Arial. In some sizes lines are cut.
I have tryed a lot of ways to render the text in printing, Graphics2D.drawString
, SwingUtilities2.drawString
, TextLayout.drawString
, but in some cases lines are still cut, or lines are not cut but some kind of justification makes disapear white spaces.
So my idea is try to render components with sun.java2d.SunGraphics2D and "copy" the surface to the printer via sun.print.PeekGraphics
or sun.awt.windows.WPathGraphics
.
Thanks in advance.