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

Rotated Japanese characters are drawn upright

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      ADDITIONAL SYSTEM INFORMATION :
      OS : Windows 7 64 bit Japanese
      Java version : Java 11 early access 17
      This happens with both OpenJDK builds and Oracel JDK builds.

      A DESCRIPTION OF THE PROBLEM :
      When a String that includes Japanese characters are rotated and drawn, the Japanese characters are always drawn upright. I expect that the Japanese characters should be drawn with rotation, too.

      Alphabet characters are rotated along with the angle of String. However Japanese characters are always not rotated. They are always upright.

      REGRESSION : Last worked in version 10.0.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      public static void main(String[] args) {
      System.out.println(System.getProperty("java.version"));
      BufferedImage bi = new BufferedImage(1024, 1024, BufferedImage.TYPE_INT_ARGB);
      Graphics2D g2d =(Graphics2D)bi.getGraphics();

      for(double a = 0;a < Math.PI*2; a+=Math.PI/36d){
      AffineTransform at = new AffineTransform();
      at.setToRotation(a);
      g2d.setTransform(at);
      double d =(int)( a * 180 / Math.PI + 0.1);
      g2d.setColor(Color.BLACK);
      g2d.drawString("ああああabc_rotated_"+d, 300, 0);
      }
      try{
      ImageIO.write(bi, "PNG", new File(System.currentTimeMillis() + ".png"));
      }catch(Exception ex){
      ex.printStackTrace();
      }
      }


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Both Japanese and Alphabetical characters are rotated depending on the angle of AffineTransform.
      ACTUAL -
      Japanese characters are always upright, whereas alphabetic characters are drawn with angles.

      FREQUENCY : always


        Attachments

        1. 11eab18.png
          11eab18.png
          20 kB
        2. 8u172.png
          8u172.png
          15 kB
        3. RotateTest.java
          1.0 kB

          Issue Links

            Activity

              People

              • Assignee:
                prr Philip Race
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: