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

2D drawing methods crash VM for 96 point Japanese character on Solaris26ja

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • CPU:
      generic
    • OS:
      solaris_2.6

      Description

      The following test case shows the problem, when I change the fontsize
      to 80 point, everything works fine.

      Not only TextLayout.getOutline(), drawString() method also crashes the
      VM when the output string is Japanese. Ascii string is OK.


      import java.awt.*;
      import java.awt.font.*;
      import java.awt.event.*;
      import java.awt.geom.*;

      public class ShapeTest extends Frame {

          String chars;

          public ShapeTest(String chars) {
      super("Shape Test");

      this.chars = chars;

      addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
      System.exit(0);
      }
      });
      setSize(300,200);
      show();
          }

          public void paint(Graphics g) {
      Graphics2D g2d = (Graphics2D)g;
      Font f = new Font("Serif", Font.BOLD, 96);
      /*
              g2d.setFont(f);
              g2d.drawString(chars, 50, 150);
      */
      TextLayout tl = new TextLayout(chars, f, g2d.getFontRenderContext());
      AffineTransform af = new AffineTransform();
      Shape shape = tl.getOutline(af);
      g2d.translate(50,150);
              g2d.draw(shape);
          }

          public static void main(String args[]) {
              //new ShapeTest(args[0]);
      new ShapeTest("\u6f22\u5b57");
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sherman Xueming Shen
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: