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

PrintJob font problem on JDK1.2, it works on JDK1.1.x

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.2.0
    • client-libs
    • x86
    • windows_nt


      ingrid.yao@Eng 1999-04-15

      Compile and run the following test case on JDK1.1.7/JDK1.1.8,
      2.93Kb where sent to the printer and the results where very "crisp".
      But if you compile and run it on JDK1.2/JDK1.2.1, only 131Kb
      where sent to the printer and the results where very grainy,
      like it was printed on a dot matrix printer. Also, only the
      last string was printed.

      Platform:
      ==========
      Windows NT 4.0, service pack 4, and has 128 Mb of ram.

      test case:
      ==========
      import java.awt.*;

      public class PrintJobTest extends Frame
      {
          public static void main( String[] args )
          {
           new PrintJobTest();
              System.exit( 0 );
          }

          public PrintJobTest()
          {
              java.awt.PrintJob pj = getToolkit().getPrintJob( this, "Print Job Test", null );
              if (pj != null) {
                  Graphics pg = pj.getGraphics();

                  if (pg != null) {
                      print( pg );
                      pg.finalize();
                  }
                  pj.end();
                  pj.finalize();
              } else {
                  System.err.println( "pj = null" );
              }
          }

          public void print( java.awt.Graphics g )
          {
              g.setColor( java.awt.Color.black );
              g.drawString( "Print Job Test", 72, 72 );
              g.drawString( "The VM Vendor = " + System.getProperty( "java.vendor" ), 72, 144 );
              g.drawString( "The VM Version = " + System.getProperty( "java.version"), 72, 216 );
              g.drawString( "The Class Version = " + System.getProperty( "java.class.version" ), 72, 288 );
          }
      }

            Unassigned Unassigned
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: