-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
7u21
-
windows_7
FULL PRODUCT VERSION :
java version " 1.7.0_21 "
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Since Java 1.7 we have problems to print Japanese characters using the java.awt.print.PrinterJob if the String contains both Japanese characters and digits, the characters overlaps.
REGRESSION. Last worked in version 6u45
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code below
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Printing on default printer with no overlapping characters
ACTUAL -
Printing on default printer with overlapping characters
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Graphics;
import java.awt.print.Book;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
/**
* This class prints a String containing Japanese characters and numbers
*
* in Java 1.6 the String is correctly printed
* in Java 1.7 we have an overlapping of the Japanese characters
*
*/
public class PrintTest {
/**
* @param args no args
* @throws PrinterException
*/
public static void main(String[] args) throws PrinterException {
// Get the default printer
PrintService printService = PrintServiceLookup.lookupDefaultPrintService();
// Create a new Job
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintService(printService);
// Create a new printable with Japanese characters
Printable page = new Printable() {
@Override
public int print(Graphics graphics, PageFormat pageFormat,
int pageIndex) throws PrinterException {
// Please note that there is a number in the middle of the string
graphics.drawString( " ???8???? " , 100, 100);
return 0;
}
};
// Create a book and print it
Book book = new Book();
PageFormat pageFormat = new PageFormat();
book.append(page, pageFormat);
job.setPageable(book);
job.print();
}
}
---------- END SOURCE ----------
java version " 1.7.0_21 "
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Since Java 1.7 we have problems to print Japanese characters using the java.awt.print.PrinterJob if the String contains both Japanese characters and digits, the characters overlaps.
REGRESSION. Last worked in version 6u45
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code below
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Printing on default printer with no overlapping characters
ACTUAL -
Printing on default printer with overlapping characters
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Graphics;
import java.awt.print.Book;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
/**
* This class prints a String containing Japanese characters and numbers
*
* in Java 1.6 the String is correctly printed
* in Java 1.7 we have an overlapping of the Japanese characters
*
*/
public class PrintTest {
/**
* @param args no args
* @throws PrinterException
*/
public static void main(String[] args) throws PrinterException {
// Get the default printer
PrintService printService = PrintServiceLookup.lookupDefaultPrintService();
// Create a new Job
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintService(printService);
// Create a new printable with Japanese characters
Printable page = new Printable() {
@Override
public int print(Graphics graphics, PageFormat pageFormat,
int pageIndex) throws PrinterException {
// Please note that there is a number in the middle of the string
graphics.drawString( " ???8???? " , 100, 100);
return 0;
}
};
// Create a book and print it
Book book = new Book();
PageFormat pageFormat = new PageFormat();
book.append(page, pageFormat);
job.setPageable(book);
job.print();
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8008535 JDK7 Printing : CJK and Latin Text in a string overlap.
-
- Closed
-
-
JDK-8008535 JDK7 Printing : CJK and Latin Text in a string overlap.
-
- Closed
-