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

When Printing Strings including DBCS and alphabet/Nums, these are overstriking.

    Details

    • Subcomponent:
      2d
    • OS:
      windows_xp

      Description

      FULL PRODUCT VERSION :
      JRE 7 Update 11/13

      ADDITIONAL OS VERSION INFORMATION :
      WIndows XP and 7

      A DESCRIPTION OF THE PROBLEM :
      Printing Strings which include Japanese characters and alphabet/Nums characters, by Graphics.drawSting(), these are overstriking.
      It's only printing, not appear displaying.
      And It looks, when changing font face or configuration, start coordination of print is reseted.

      With JRE 6, not happen. Happen with JRE 7 only.

      REGRESSION. Last worked in version 7

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      You can use following sample codes.

      --------------------------------

      import java.awt.Font;
      import java.awt.Graphics;
      import java.awt.print.PageFormat;
      import java.awt.print.Printable;
      import java.awt.print.PrinterException;
      import java.awt.print.PrinterJob;

      public class PrintMultiCharsTest {

          public static void main(String[] args) throws Exception {

              PrinterJob job = PrinterJob.getPrinterJob();
              Printable printable = new TestPrintable();
              job.setPrintable(printable);

              if (job.printDialog()) {
                  job.print();
              }
          }

          static class TestPrintable implements Printable {

              @Override
              public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
                  if (pageIndex < 1) {

                      // default font
                      g.drawString( " ABC123あいう " , 50, 50);

                      // serif
                      g.setFont(new Font( " serif " , Font.PLAIN, 24));
                      g.drawString( " ABC123あいう " , 50, 100);

                      // monospaced
                      g.setFont(new Font( " monospaced " , Font.PLAIN, 24));
                      g.drawString( " ABC123あいう " , 50, 150);
                      
                      // japanese physical font ==> OK
                      g.setFont(new Font( " MS Mincho " , Font.PLAIN, 24));
                      g.drawString( " ABC123あいう " , 50, 200);

                      return Printable.PAGE_EXISTS;
                  } else {
                      return Printable.NO_SUCH_PAGE;
                  }
              }
          }
      }



      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Modifying the configration of fontconfig.properties.

      for example.

      DEFAULT

       sequence.serif.windows-31j=alphabetic,japanese,dingbats,symbol

      WORKAROUND

      sequence.serif.windows-31j=japanese,dingbats,symbol

      But when using workaround configration, Alphabet/Nums are printing by Japanese font.
      It looks, when changing font face or configuration, start coordination is reseted.

        Attachments

          Activity

            People

            • Assignee:
              anashaty Anton Nashatyrev (Inactive)
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: