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

Syriac fonts not supported properly in Java (AWT/Swing)

    Details

    • Subcomponent:
      2d
    • CPU:
      x86
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :
      java version "1.7.0_07"
      Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
      Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 64-bit
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      The syriac fonts are not properly supported in AWT and Swing text components (e.g. TextArea, JTextArea).

      There's a report on the web made by someone a long time ago (2006) which details the problems (images included) with Java/Swing and Syriac writing:
      http://nazianzos.fltr.ucl.ac.be/ReportSyriac.htm
      Section "The problem when displaying syriac characters in java"
      The problems are the same even now in Java SE 6u35 and 7u7.

      The main problem that we found is that, even when the fonts work (tested with "Estrangelo Edessa" and "Estrangelo Talada"), the characters in a word are not linked together.

        Interestingly enough they seem to work fine within TextField.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The characters in each word should be linked together.
      Copy the Syriac text from the running application and paste it into Notepad/Wordpad. You will see how the characters should look (correctly linked).
      ACTUAL -
      The characters in each word are not linked together.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Dimension;
      import java.awt.Font;

      import javax.swing.JFrame;
      import javax.swing.JScrollPane;
      import javax.swing.JTextArea;

        public static void main(String[] args) {
          JFrame frame = new JFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          
          final JTextArea text = new JTextArea();
          Font m_Font = new Font ("Estrangelo Edessa", Font.PLAIN, 30);
          text.setFont( m_Font );
          text.setText( "\u0712\u072A\u071D\u072B\u071D\u072C \u0710\u071D\u072C\u0718\u0717\u071D \u0717\u0718\u0710 \u0721\u0720\u072C\u0710\n" +
           "\u071f\u072c\u0712\u071d\u0722\u0722 \u072c\u0718\u0712 \u0722\u0712\u071d\u0718\u0308\u072c\u0710 \u0715\u0726\u0720\u0720\u0718\u0308\u0723\u0718\u0726\u0710 \u071a\u0722\u0308\u0726\u0710 \u0710\u071d\u071f \u0715\u0712\u0726\u0723\u071d\u0308\u0729\u072c\u0710");
          
          frame.getContentPane().add(new JScrollPane(text));
          frame.setSize(new Dimension(600, 200));
          frame.setVisible(true);
        }
      ---------- END SOURCE ----------

        Issue Links

          Activity

          Hide
          prr Philip Race added a comment -
          BT2:EVALUATION

          The problem is that ICU opentype layout does not support Syriac layout.
          There's an open ICU ticket on this :-
          http://bugs.icu-project.org/trac/ticket/2387
          Its not clear that this is a priority as its a 'dead' language, although
          (if I believe wikipedia, which isn't a given) apparently its still used
          as the liturgical language of Syriac Christianity.
          Show
          prr Philip Race added a comment - BT2:EVALUATION The problem is that ICU opentype layout does not support Syriac layout. There's an open ICU ticket on this :- http://bugs.icu-project.org/trac/ticket/2387 Its not clear that this is a priority as its a 'dead' language, although (if I believe wikipedia, which isn't a given) apparently its still used as the liturgical language of Syriac Christianity.
          Hide
          prr Philip Race added a comment -
          And further to the above JDK's font code therefore does not attempt to perform layout on this range.
          JDK 9 may use harfbuzz which might support this script, in which case we can add it then.
          Adding for consideration in 9
          Show
          prr Philip Race added a comment - And further to the above JDK's font code therefore does not attempt to perform layout on this range. JDK 9 may use harfbuzz which might support this script, in which case we can add it then. Adding for consideration in 9
          Hide
          srl Steven Loomis added a comment -
          Verified this is fixed by 8143177 harfbuzz!
          Show
          srl Steven Loomis added a comment - Verified this is fixed by 8143177 harfbuzz!
          Hide
          srl Steven Loomis added a comment -
          Fixed by Harfbuzz
          Show
          srl Steven Loomis added a comment - Fixed by Harfbuzz
          Hide
          prr Philip Race added a comment -
          Confirmed as fixed in JDK 9 on Windows 7 by the harfbuzz integration. Closing as a duplicate.
          Show
          prr Philip Race added a comment - Confirmed as fixed in JDK 9 on Windows 7 by the harfbuzz integration. Closing as a duplicate.

            People

            • Assignee:
              prr Philip Race
              Reporter:
              rlewis Roger Lewis
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: