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

Printing and display problems with east european unicode characters

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_95

      Description

      Some code points in various languages are not printing. We are using drawString and drawChars on the Graphics of a PrintJob. Many of these characters are not displaying properly on a canvas either.

      Licensee now says that problem only occurs on Windows 95 -- not Windows NT.

      CZECH (Codepage 870)
      codepoints(hex)
      44 46 47 49 52 54 57 58 64 66 67 69 70
      72 74 77 78 80 8A 8B 8C 8E 8F 9A 9B 9E
      A0 AA AB AC AE AF B0 B1 B2 B3 B4 B6 B7
      B8 B9 BA BB CD CF DA DB DD DF EA ED EF
      FA FB FD

      GREEK(Codepage 875)
      Codepoints(hex)
      41 42 43 44 45 46 47 48 49 51 52 53 54
      55 56 57 58 59 62 63 64 65 66 67 68 69
      71 72 73 74? 75 76 77 78 80 8A 8B 8C 8D
      8E 8F 9A 9B 9C 9D 9E 9F AA AB AC AD AE
      AF B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC
      BD BE BF CB CC CD CF DD

      RUSSIAN(Codepage 1025)
      Codepoints(hex)
      41? 42 43 44 45 46 47 48 49 51 52 53 54
      55 56 57 58 59 62 63 64 65 66 67 68 69
      70 71 72 74 75 76 77 78 80 8A 8B 8C 8D
      8E 8F 90 9A 9B 9C 9D 9E 9F AA AB AC AD
      AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA
      BB BC BD BE BF CA CB CC CD CE CF DA DB
      DC DD DE DF EA DB EC ED EE EF FA FB FC
      FD FE

      TURKISH(Codepage 1026)
      Codepoints(hex)
      41? 5A 5B 6A 79 7C B3 D0
      Here is an example of the problem with 3 Russian characters not printing :-

      import java.awt.*;
      import java.awt.event.*;

      public class PrintingTest extends Frame implements ActionListener {

          PrintCanvas canvas;

          public PrintingTest() {
              super("Printing Test");
              canvas = new PrintCanvas();
              add("Center", canvas);

              Button b = new Button("Print");
              b.setActionCommand("print");
              b.addActionListener(this);
              add("South", b);

              pack();
          }

          public void actionPerformed(ActionEvent e) {
              String cmd = e.getActionCommand();
              if (cmd.equals("print")) {
                  PrintJob pjob = getToolkit().getPrintJob(this,
                                     "Printing Test", null);

                  if (pjob != null) {
                      Graphics pg = pjob.getGraphics();

                      if (pg != null) {
                          canvas.printAll(pg);
                          pg.dispose(); // flush page
                      }
                      pjob.end();

                  }
              }
          }

          public static void main(String args[]) {
              PrintingTest test = new PrintingTest();
              test.show();
          }
      }

      class PrintCanvas extends Canvas {

          public Dimension getPreferredSize() {
              return new Dimension(100, 100);
          }

          public void paint(Graphics g) {
              Rectangle r = getBounds();

              g.setColor(Color.yellow);
              g.fillRect(0, 0, r.width, r.height);

              Font font = new Font("Courier", Font.BOLD, 11);
              g.setFont(font);
              g.setColor(Color.black);

              char[] unicode = {'\u0041', '\u0042', '\u0043', '\u0403', '\u0401',
      '\u0404'};
              String tempText = new String(unicode);
              g.drawString(tempText, 10, 70);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ibdsunw Ibd Ibd (Inactive)
                Reporter:
                alanb Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: