Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7169975

PrintJob interprets some diacritics as carriage return

XMLWordPrintable

    • 2d
    • b08
    • 7
    • x86
    • windows_7

        FULL PRODUCT VERSION :
        java version "1.7.0_04"
        Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
        Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.1.7601]

        EXTRA RELEVANT SYSTEM CONFIGURATION :
        tested with HP LaserJet P2015 PCL6

        A DESCRIPTION OF THE PROBLEM :
        The class PrintJob interprets some diacritics as carriage return. This bug appears in Java 1.7.

        REGRESSION. Last worked in version 6u31

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Launch the attached sample program

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Printed page with readable output
        ACTUAL -
        Printed page with overlapped output

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.awt.*;

        public class PrintBug {

        public static void main(String[] args) throws PrinterException{
        PrinterJob pjob = PrinterJob.getPrinterJob();
        if (pjob.printDialog()) {
        pjob.setPrintable(new Printable() {
        private Font font = new Font( "Times", Font.PLAIN, 20 );
        public int print(Graphics g, PageFormat pageFormat, int pageIndex) {
        if (pageIndex >= 1)
        return Printable.NO_SUCH_PAGE;
        g.setFont(font);
        g.drawString("Print bug in 1.7. Java ...", 100, 100);
        g.drawString("Hello \u0092 World!!!", 100, 200);
        return Printable.PAGE_EXISTS;
        }
        });
        pjob.print();
        }
        }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        No workaround

              alexp Alexander Potochkin (Inactive)
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: