wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes Unicode Subscript issue (Khmer Script) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Unicode Subscript issue (Khmer Script)" Watch "Unicode Subscript issue (Khmer Script)" New topic
Author

Unicode Subscript issue (Khmer Script)

Subin Martin
Greenhorn

Joined: Aug 08, 2010
Posts: 5
Hi,

I am having an issue with Khmer Unicode font. The program reads from a UTF-8 file and then writes the string to a JPEG file. In Khmer font there are subscripts for each character. These subscripts are appearing as a separate character in the JPG file. Please see "not_needed.png" in the attachment. The needed.png shows the correct display as shown in the text editor. I am able to get the correct format by using Javascript also. But not with Java.
Do someone have any idea as to why Java separates the subscript unicode character? I use Kh-Battambang.ttf as the font for displaying. As far as I know in Indic fonts also subscript is there.

I would be very thankful if someone could give me pointers to where the issue is. Thanks in advance.

Regards,
Subin


[Thumbnail for not_needed.png]

[Thumbnail for needed.png]

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Have you found that other applications render the Khmer subscripts correctly, using that font?

And have you tested to see if Java renders them correctly in (say) a Swing text component, using that font?

I ask those questions because the problem might be with the font, or with Java's handling of the font, or with the code you produced to convert the string to a jpg. They would eliminate the first two possibilities.
Subin Martin
Greenhorn

Joined: Aug 08, 2010
Posts: 5
Paul Clapham wrote:Have you found that other applications render the Khmer subscripts correctly, using that font?

And have you tested to see if Java renders them correctly in (say) a Swing text component, using that font?

I ask those questions because the problem might be with the font, or with Java's handling of the font, or with the code you produced to convert the string to a jpg. They would eliminate the first two possibilities.


Hi Paul,

Thanks for the mail.
1) I didnt find other applications that render Khmer subscripts correctly using this font. I tried some days back with php GD still the same output as Java. This font is a standard Khmer font. Also I tried with all available Khmer fonts. These fonts are used by different applications. But no success.
2) I tried it with swing text component, but still same issue is there. I tried an online applet (http://www.easybabel.com/html/kh-khm-kbd.html) which basically is an online Khmer keyboard. There it is possible to open an UTF-8 document and also paste the khmer text. I tried it and there also i am getting the same issue. I read that from Java v 1.6 khmer is supported and I run v 1.6.
Also if you see in this conversion site (http://rishida.net/tools/conversion/) for decimal NCR ថៃ្ងសម្រាក we get the corresponding text as ថៃ្ងសម្រាក If I copy this text and paste to the online applet described above, I still get the issue where the subscript is removed from the parent.
Does this have to with my font settings in the java lib directory? or is this incompatibility of the font?

Thanks again for the help.

Regards,
Subin


Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Then I would say if other applications don't handle the font correctly, it isn't surprising that Java doesn't handle it correctly. Maybe there's a problem of some kind with the font.
Subin Martin
Greenhorn

Joined: Aug 08, 2010
Posts: 5
Paul Clapham wrote:Then I would say if other applications don't handle the font correctly, it isn't surprising that Java doesn't handle it correctly. Maybe there's a problem of some kind with the font.


Thanks Paul.

Regards,
Subin
Ben Dhien
Greenhorn

Joined: Sep 22, 2010
Posts: 1
Hello,

What about changing the letter order:
ថ្ងៃសម្រាក = ថ + ្ + ង + ៃ + ស + ម + ្+ រ + ា + ក

Does it make sense for Khmer writers?

Regards,

Benoit



[Thumbnail for Capture.JPG]

Nathan Wells
Greenhorn

Joined: Jan 17, 2011
Posts: 1
Was there ever any resolution to this? I am also having trouble with Khmer in Java applications (OmegaT and jEdit).

Thanks,
Nathan Wells
sbbic.org
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unicode Subscript issue (Khmer Script)
 
Similar Threads
can somebosy help me in showing unicode in stand alone app
Using Subscript in Title Bar?
Unicodes
Retaining Superscript and Subscript fronts in Vector
java coding and unicode