• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unicode Subscript issue (Khmer Script)

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
not_needed.png
[Thumbnail for not_needed.png]
needed.png
[Thumbnail for needed.png]
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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

Does it make sense for Khmer writers?

Regards,

Benoit
Capture.JPG
[Thumbnail for Capture.JPG]
by changing letter order
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic