Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Unicode Characters on Screen

Reply
Thread Tools

Unicode Characters on Screen

 
 
Phillip Lord
Guest
Posts: n/a
 
      07-24-2003



I'm a little confused over unicode support within java.

If I do something like....

JLabel label = new JLabel();
label.setText( "0" + (char)0x2800 + 1 + (char)0x2801 + 2 + (char)0x2802 );

which I expect to put the three characters "0 1 2" onto screen
separated by the three characters which turn out to be the first three
braille dot characters, in fact I get "0 1 2" separated by little
boxes which in my experience tends to indicate "I don't know how to
draw this character".

Does anyone know how I get the actual characters to appear?

Phil
 
Reply With Quote
 
 
 
 
John C. Bollinger
Guest
Posts: n/a
 
      07-24-2003
Phillip Lord wrote:
>
>
> I'm a little confused over unicode support within java.
>
> If I do something like....
>
> JLabel label = new JLabel();
> label.setText( "0" + (char)0x2800 + 1 + (char)0x2801 + 2 + (char)0x2802 );
>
> which I expect to put the three characters "0 1 2" onto screen
> separated by the three characters which turn out to be the first three
> braille dot characters, in fact I get "0 1 2" separated by little
> boxes which in my experience tends to indicate "I don't know how to
> draw this character".
>
> Does anyone know how I get the actual characters to appear?


Use a Font for the JLabel that contains glyphs for those characters.
I'm not certain offhand what fonts might be suitable.


John Bollinger
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
 
Manish Jethani
Guest
Posts: n/a
 
      07-24-2003
Phillip Lord wrote:

> I'm a little confused over unicode support within java.
>
> If I do something like....
>
> JLabel label = new JLabel();
> label.setText( "0" + (char)0x2800 + 1 + (char)0x2801 + 2 + (char)0x2802 );
>
> which I expect to put the three characters "0 1 2" onto screen
> separated by the three characters which turn out to be the first three
> braille dot characters, in fact I get "0 1 2" separated by little
> boxes which in my experience tends to indicate "I don't know how to
> draw this character".
>
> Does anyone know how I get the actual characters to appear?


Use a suitable font.

-Manish

--
Manish Jethani (manish.j at gmx.net)
phone (work) +91-80-51073488

 
Reply With Quote
 
John O'Conner
Guest
Posts: n/a
 
      07-25-2003
Phillip Lord wrote:
>
>
> I'm a little confused over unicode support within java.
>
> If I do something like....
>
> JLabel label = new JLabel();
> label.setText( "0" + (char)0x2800 + 1 + (char)0x2801 + 2 + (char)0x2802 );


label.setText("0\u28001\u28012\u2802");


>
> Does anyone know how I get the actual characters to appear?
>


Use a font that contains the Braille characters.

Regards,
John O'Conner

 
Reply With Quote
 
Phillip Lord
Guest
Posts: n/a
 
      07-25-2003
>>>>> "David" == David Zimmerman <(E-Mail Removed)> writes:

David> Phillip Lord wrote:
>> I'm a little confused over unicode support within java. If I do
>> something like....


>> JLabel label = new JLabel();


>> label.setText( "0" + (char)0x2800 + 1 + (char)0x2801 + 2 +
>> (char)0x2802 ); which I expect to put the three characters "0 1
>> 2" onto screen


>> separated by the three characters which turn out to be the first
>> three braille dot characters, in fact I get "0 1 2" separated by
>> little boxes which in my experience tends to indicate "I don't
>> know how to draw this character". Does anyone know how I get the
>> actual characters to appear?


>> Phil



David> Does the font you're using have those glyphs?


Okay, from the four identical responses that I got (use the right
font) I realise that I have been remiss in asking the question.

From the results I got, the font does not have those glyphs. Clearly
such font's do exist.

So the real questions are

1) Do any of the standard defined fonts for java have these glyphs?
2) If not can I install new fonts into Java, that will have these
glyphs?
3) If I can how do I install such fonts? Can I do it programmatically?
4) Can any one suggest a good set of fonts with these characters in?


I'm starting to think that the sane course of action would be just to
draw these glyphs on screen "by hand" rather than with unicode. They
are, after all, fairly simple glyphs.


Phil
 
Reply With Quote
 
Andy Flowers
Guest
Posts: n/a
 
      07-25-2003
This may or may not help.

But the SDK comes with a nifty little font viewer. In my JDK this is <JDK
Root>\demo\jfc\Font2DTest\Font2DTest.jar

This may help you have a look at what fonts produce what output.

The caveat may be that you may find a font on a Windows machine that has
what you want, but this might not be there on Linux/Unix, but as most of the
worlds graphical clients are Windows this may not be too much of a
problem...



"Phillip Lord" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> >>>>> "David" == David Zimmerman <(E-Mail Removed)> writes:

>
> David> Phillip Lord wrote:
> >> I'm a little confused over unicode support within java. If I do
> >> something like....

>
> >> JLabel label = new JLabel();

>
> >> label.setText( "0" + (char)0x2800 + 1 + (char)0x2801 + 2 +
> >> (char)0x2802 ); which I expect to put the three characters "0 1
> >> 2" onto screen

>
> >> separated by the three characters which turn out to be the first
> >> three braille dot characters, in fact I get "0 1 2" separated by
> >> little boxes which in my experience tends to indicate "I don't
> >> know how to draw this character". Does anyone know how I get the
> >> actual characters to appear?

>
> >> Phil

>
>
> David> Does the font you're using have those glyphs?
>
>
> Okay, from the four identical responses that I got (use the right
> font) I realise that I have been remiss in asking the question.
>
> From the results I got, the font does not have those glyphs. Clearly
> such font's do exist.
>
> So the real questions are
>
> 1) Do any of the standard defined fonts for java have these glyphs?
> 2) If not can I install new fonts into Java, that will have these
> glyphs?
> 3) If I can how do I install such fonts? Can I do it programmatically?
> 4) Can any one suggest a good set of fonts with these characters in?
>
>
> I'm starting to think that the sane course of action would be just to
> draw these glyphs on screen "by hand" rather than with unicode. They
> are, after all, fairly simple glyphs.
>
>
> Phil



 
Reply With Quote
 
Phillip Lord
Guest
Posts: n/a
 
      07-25-2003
>>>>> "Andy" == Andy Flowers <(E-Mail Removed)> writes:

Andy> This may or may not help.

Andy> But the SDK comes with a nifty little font viewer. In my JDK
Andy> this is <JDK Root>\demo\jfc\Font2DTest\Font2DTest.jar

Andy> This may help you have a look at what fonts produce what
Andy> output.

Andy> The caveat may be that you may find a font on a Windows
Andy> machine that has what you want, but this might not be there on
Andy> Linux/Unix, but as most of the worlds graphical clients are
Andy> Windows this may not be too much of a problem...

Indeed it does. Sadly none of the fonts on my system has the braille
fonts. A bit of a pity.

I think its looking more likely that the appropriate solution is to
draw the glyphs by hand.

Cheers

Phil
 
Reply With Quote
 
Phillip Lord
Guest
Posts: n/a
 
      07-25-2003
>>>>> "Andy" == Andy Flowers <(E-Mail Removed)> writes:

Andy> This site may also help

Andy> http://www.alanwood.net/unicode/braille_patterns.html

Also useful! It shows, if nothing else, that my web browser can
display the braille glyphs....


Phil
 
Reply With Quote
 
Andy Flowers
Guest
Posts: n/a
 
      07-25-2003
There are fonts that can be downloaded to display the Braille character set.
Some are free, other not.

A quick google search on "Braille font download" should give some ideas,
especially at http://www.tsbvi.edu/braille-resourc...pecialty-fonts which includes,
amongst others, a font from the UK Royal National Institute for the Blind
(RNIB) which should have all you need.

"Phillip Lord" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> >>>>> "Andy" == Andy Flowers <(E-Mail Removed)> writes:

>
> Andy> This site may also help
>
> Andy> http://www.alanwood.net/unicode/braille_patterns.html
>
> Also useful! It shows, if nothing else, that my web browser can
> display the braille glyphs....
>
>
> Phil
 
Reply With Quote
 
Phillip Lord
Guest
Posts: n/a
 
      07-25-2003
>>>>> "Andy" == Andy Flowers <(E-Mail Removed)> writes:

Andy> There are fonts that can be downloaded to display the Braille
Andy> character set. Some are free, other not.

Andy> A quick google search on "Braille font download" should give
Andy> some ideas, especially at
Andy> http://www.tsbvi.edu/braille-resourc...pecialty-fonts which includes,
Andy> amongst others, a font from the UK Royal National Institute
Andy> for the Blind (RNIB) which should have all you need.

Yeah, I found these. The problem is that I have absolutely no idea
what to do with these wrt java. It would also be nice to have stuff
work cross platform.

Phil
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python unicode utf-8 characters and MySQL unicode utf-8 characters Grzegorz Śliwiński Python 2 01-19-2011 07:31 AM
Re: convert unicode characters to visibly similar ascii characters Laszlo Nagy Python 6 07-02-2008 04:42 PM
Re: convert unicode characters to visibly similar ascii characters M.-A. Lemburg Python 0 07-02-2008 08:39 AM
Re: convert unicode characters to visibly similar ascii characters Terry Reedy Python 0 07-01-2008 07:46 PM
Unicode + jsp + mysql + tomcat = unicode still not displaying Robert Mark Bram Java 0 09-28-2003 05:37 AM



Advertisments