File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Unicode in TextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unicode in TextArea" Watch "Unicode in TextArea" New topic
Author

Unicode in TextArea

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

How can I show unicode characters from range \u0900 to \u097F in TextArea? They are not visible in TextArea, but JTextArea shows them properly. Is there any way to show them properly, as intended in TextArea?
TIA,
- Manish
John Dale
Ranch Hand

Joined: Feb 22, 2001
Posts: 399
I'm not real good with this stuff don't optional character support installed on my workstation, so I cannot check out what I'm saying, but ...
Have you specified a font that includes Devaganari? Is that font configured for use with the native windowing system on your computer (e.g, Windows or Motif). If not, it may be substituting a font that does not support those characters.
If you are using Windows, you might use the character map accessory to see if the font you selected is present and supports those characters.
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Thanks John,
I am using windows 2000, and font is standard "dialog" font of Java, and I just intend to display all the available chracters. My questions is why it works with JTextArea and not with TextArea? I thought Java awt compoents had unicode support since very begining.
Does anybody know if it's a known issue or sth...
- Manish
John Dale
Ranch Hand

Joined: Feb 22, 2001
Posts: 399
I would think that for AWT components, the glyphs generation is completely under control of the the underlying operating system. So if whatever font your system uses for "dialog" (ariel on my machine) does not have glyphs for these characters, you won't see them.
In Swing, the glyphs are generated and placed in the bitmap representing the screen within the Java environment, which can be configured to map and support the fonts differently. (See jre/lib/font.properties .)
I'm pretty sure that on my machine, none of the fonts currently installed include the Devanganari characters, so I would not expect to see them in either Swing or AWT widgets, even though Unicode is supported. I expect your machine has some fonts that support Devanganari, and some that don't. If Windows machine, you should be able to use the Character Map accessory to see that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unicode in TextArea