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

JDK on Linux: doesn't draw a rotated/tall string completely

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P4
    • None
    • 1.4.0, 5.0, 5.0u1, 6
    • client-libs
    • 2d
    • x86
    • linux, linux_redhat_3.0, linux_redhat_9.0, solaris_10

    Description

      ============================================================================
      Tested JDK :
      b50
      Tested OS: Cinnabar, RD AS 3
      Locale: zh_CN
      Video: NVIDIA GeForce4
      Test host: i18n-gw700-9, i18n-gw700-8
      ============================================================================

      GlobalSuit test case
      font-render/2d/one/TextTransformRenderTest.java

      The transformed text string dosen't display completely, after moving around the text frame, it sometimes got displayed completely.

      Tested with earlier builds up to b33, there is a minor difference between builds prior b44 and builds after b45, but the major symptom is same for all the tested builds.

      This can only be reproduced on the above two platforms, not on Solaris.
      This symptom can not be seen using CharView or Font2DTest.

      To reproduce, get gs bundle gs15-06.tar.gz from
      /net/sqesvr-nfs/global/nfs/i18n/workspaces/i18n_tiger_ws/i18n/bundles/b06

      after untar, go to i18n/src/GS

      sh run_gs.sh -jdk:[test jdk] font-render/2d/one/TextTransformRenderTest.java

      ###@###.### 2004-05-12
      Here is a test case contributed by a developer that was added to the JDC
      comments for 5106732 (closed as a dup of this one)
      He noted it reproduced on Fedora Core 1.

      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.ActionEvent;

      public class Bug extends JPanel
      {
        public Bug()
        {
          setPreferredSize(new Dimension(800,500));
        }

        public void paint(Graphics g)
        {
          super.paint(g);
          for (int i = 300; i < 360; i++){
            Graphics2D g2d = (Graphics2D) g.create();
            g2d.scale(4, 4);
            g2d.rotate(Math.toRadians(i), 30, 30);
            int c = (i*20)%255;
            g2d.setColor(new Color(c, c, 255));
            g2d.drawString("XXXXXXXXXXXX", 30, 100);
            g2d.setColor(Color.red);
            g2d.drawLine(30,100, 120,100);
            g2d.dispose();
          }
        }
        
        public static void main(String[] args){
          JFrame frame = new JFrame();
          final JPanel bug = new Bug();
          frame.getContentPane().add(bug, BorderLayout.CENTER);
          JPanel buttons = new JPanel();
          frame.getContentPane().add(buttons, BorderLayout.SOUTH);
          buttons.add(new JButton(new AbstractAction("Reset Bug"){
            public void actionPerformed(ActionEvent evt){
              bug.repaint();
            }
          }));
          buttons.add(new JButton(new AbstractAction("Less Buggy"){
            public void actionPerformed(ActionEvent evt){
              bug.repaint(bug.getWidth()/2, 0, bug.getWidth()/2, bug.getHeight());
            }
          }));
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.pack();
          frame.setVisible(true);
        }
      }

      Attachments

        Issue Links

          Activity

            People

              prr Philip Race
              mtiensunw Minchi Tien (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: