JDK-8008535 : JDK7 Printing : CJK and Latin Text in a string overlap.
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.
When printing text by Java7, some letters are overlapped.
For example, graphics2d.drawString(Japanse+English) causes the
Japanese letters and English letters overlapping.
This is a regression from Java6, because Java6 doesn't have
I can reproduce this from JDK 7 b08 onwards.
My guess is that its due to a bug in the fix for
6425068 : Mismatch between the drawing width and font metrics
One part of that fix was to assign glyph positions in certain cases.
If we aren't adding the start position of a new run then you would get this overlapping
To reproduce the bug,
1. Compile DrawPanel.java, Print.java and Frame.java
2. Exec Print.java - Japanese text and English text overlap (see print_bug.png attached)
3. Exec Frame.java - looks work fine.
DrawPanel.java have Japanese strings in the source in UTF-8 encoding. Please compile it on UTF-8 locale.