JDK-4813842 : JTextPane doesn't word wrap Devanagari text properly.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2003-02-06
  • Updated: 2003-02-07
  • Resolved: 2003-02-07
Related Reports
Duplicate :  
Description

Name: jk109818			Date: 02/05/2003


FULL PRODUCT VERSION :
[ldd@dharma ldd]$ java -version
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)


FULL OPERATING SYSTEM VERSION :
[lddubeau@dharma lddubeau]$ rpm -q glibc
glibc-2.2.93-5

[lddubeau@dharma lddubeau]$ cat /etc/*release
Red Hat Linux release 8.0 (Psyche)

[ldd@dharma ldd]$ uname -a
Linux dharma.zen.zen 2.4.18-19.8.0 #1 Thu Dec 12 04:37:40
EST 2002 i686 athlon i386 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
If a word written with the Devanagari script must be broken
across more than one line because it is too long, the word
wrapping algorithm doesn't take care to break the word in a
sensible place.

For instance, if a long word made of a repetition of
DEVANAGARI LETTER KA + DEVANAGARI VOWEL SIGN II must be
broken, the algorithm may break it between the KA and the II
instead of always keeping each pair together.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.

Move the indicim.jar file distributed with the JDK so that
it is seen by the system as an extension.

2.

Compile and run the following:

import javax.swing.*;

public class Main
{
    public static void main(String [] args) throws Throwable
    {
        JFrame frame = new JFrame();
        JTextPane pane = new JTextPane();
        frame.getContentPane().add(pane);
        frame.show();
    }
}

(The starting frame will probably be laughably small: resize
as needed.)

3.  Switch the input method to Devanagari.

4. Type the keys "k" and "a" repetitively to create a long
chain of letters that will have to be broken by word wrapping.

5. Resize the window: it should be possible to get a window
size where the sequence of Devanagari letters is broken in
as in the description.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected:

In this example, DEVANAGARI LETTER KA + DEVANAGARI VOWEL
SIGN II should never be separated.

Actual:

They are separated.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class Main
{
    public static void main(String [] args) throws Throwable
    {
        JFrame frame = new JFrame();
        JTextPane pane = new JTextPane();
        frame.getContentPane().add(pane);
        frame.show();
    }
}

---------- END SOURCE ----------
(Review ID: 179396) 
======================================================================

Comments
EVALUATION Is JTextPane using BreakIterator to determine these breaks? If so, please reassign to classes_text. Otherwise, please make JTextPane use BreakIterator. ###@###.### 2003-02-05
05-02-2003