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

Hebrew characters are displayed in reverse order in bidi sentences

    Details

    • Subcomponent:
    • Understanding:
      Fix Understood
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: jbT81659 Date: 12/28/2001

      Locale: iw_IL

      Build: jdk1.4.0-b90

      OS: WinXP- professional(en_US), RedHat7.2(en_US), Solaris8 Intel(iw_IL)
      Test Cases: CheckboxMenuItemRenderTest1.java, ChoiceRenderTest2.java, LabelRenderTest3.java
      ListRenderTest4.java, TextFieldRenderTest1.java, TextFieldRenderTest4.java

      After executing each testcase from the above testcases, RTL characters are displayed
      in reverse order in bidi sentences with last char in each RTL word (from the left end) is diaplyed as
      the first char(from the right). LTR words are displayed correctly in the same sentence.

      To reproduce bug:
      - Test any of the test cases above with GlobalSuite.
      - Log into the OS of your choice (from above OS's)
      - Assuming that GlobalSuite is already installed, cd to GlobalSuite directory
      - To test any of the above testcases, issue the command:

           sh run_gs.sh -jdk:<jdk home> test/font-render/awt/one/<TestCase>.java
      where <TestCase> is the testcase you choose to test.
      - LabelRenderTest3.java is pasted down this page.

      - Note that RTL chars are displayed in reverse
      - Note that LTR chars are displayed correctly

      -------------Code-----------------------------
      /*
       * @test
       * @summary test "Dialog" font rendering on a label component
       * @run build DefaultRenderTest
       * @run applet/manual=done LabelRenderTest3.html
       *
       */

       import java.awt.*;
       import java.awt.event.*;
       import java.applet.*;
       import java.util.*;
       import lib.*;

       public class LabelRenderTest3 extends DefaultRenderTest
       {
          Font baseFont = new Font("Dialog", Font.PLAIN, 10);

          public void init() {
              int[] size = {10, 12, 24, 40};
              int[] styles = { Font.PLAIN, Font.ITALIC, Font.BOLD };
              String[] styleNames = { "Plain", "Italic", "Bold" };
              String[] target = new DataPool().getStringArray("SimpleWord", "long");
              Component[][] components = new Component[size.length][styles.length];
                      
                      int k=0;
              for(int i=0; i<size.length; i++) {
                  for(int j=0; j<styles.length; j++) {
                                      if(k == target.length) k=0;
                                      
                      Font font = baseFont.deriveFont(styles[j], (float)size[i]);
                      Label label = new Label(target[k++]);
                      label.setFont(font);
                      components[i][j] = label;
                  }
              }

              setComponents(size, styles, components);
          }


      }

      ----------------------------------------------
           
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              osemenovsunw Oleg Semenov (Inactive)
              Reporter:
              jbenavrasunw Jonathan Benavraham (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: