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

Incorrect i18n text document layout.

    Details

    • Subcomponent:
    • Introduced In Build:
      b96
    • Introduced In Version:
      9
    • Resolved In Build:
      b137
    • CPU:
      generic
    • OS:
      generic

      Description

      setting i18n property to true for a document brakes the text layout.

      Compile and run the next test:

      public class I18nTest {
          public static void main(String[] args) throws Exception {
              JFrame jFrame = new JFrame();
              JEditorPane component = new JEditorPane();
              component.setEditorKit(new StyledEditorKit());
              component.getDocument().putProperty("i18n", Boolean.TRUE);
              SimpleAttributeSet attrs = new SimpleAttributeSet();
              StyleConstants.setFontSize(attrs, 72);
              StyleConstants.setBold(attrs, true);
              StyleConstants.setUnderline(attrs, true);
              component.getDocument().insertString(0, "test test", null);
              component.getDocument().insertString(5, "TEST TEST TEST", attrs);
              jFrame.getContentPane().add(new JScrollPane(component));
              jFrame.setSize(300, 500);
              jFrame.setVisible(true);
          }
      }

      it produces layout shown on the l2.png screenshot, but should look like l1.png.

        Attachments

        1. l1.png
          l1.png
          18 kB
        2. l2.png
          l2.png
          20 kB

          Issue Links

            Activity

              People

              • Assignee:
                prr Philip Race
                Reporter:
                ssadetsky Semyon Sadetsky (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: