Home arrow static arrow Java Programming [Archive] - Howto use Wingdings (or other Symbol f.) without squares being displayed ?
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Howto use Wingdings (or other Symbol f.) without squares being displayed ?
10 Duke Stars available
This topic has 24 replies on 2 pages.    1 | 2 | Next »

Posts:4
Registered: 9/3/03
Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Sep 3, 2003 4:38 AM



 
Here is my Problem:

I want to display the Wingdings character ('l') which is a filled dot. (I need this for compability reasons) But I only get this missing glyph character displayed.

I am working under Java 1.4.x.

Do I have to edit the font.properties file or so ?

(I am pretty sure that I've already seen these symbols from the Wingdings font under JRE 1.3.x...)

Is there anyone who had the same or a similar problem and already solved it?
 

Posts:12
Registered: 2/18/03
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Sep 3, 2003 7:23 AM (reply 1 of 24)



 
Here is my Problem:

I want to display the Wingdings character ('l') which
is a filled dot. (I need this for compability reasons)
But I only get this missing glyph character displayed.

I am working under Java 1.4.x.

Do I have to edit the font.properties file or so ?

(I am pretty sure that I've already seen these symbols
from the Wingdings font under JRE 1.3.x...)

Is there anyone who had the same or a similar problem
and already solved it?

You should post a little more info on this. Make sure you've done the following:
1) The font file should be in the OS font directory (at least this works in Windows) or in the java font directory (which should be in the "lib" folder).
2) Test to see if Java finds the font. Use the of GraphicsEnvironment.getAllFonts() methods. It should return an array of fonts. Check to see if Wingdings is in the array.
I've used the following code for this:

Font[] fonts;
java.awt.GraphicsEnvironment ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
fonts = ge.getAllFonts();

3) If Wingdings is in the array, you should have no problems displaying it. You should use deriveFont to make sure the pointsize is large enough for displaying.

Also note that a filled dot may already be available in current fonts. Using the Character Map tool in Windows (Accessories-System Tools) you can see that both Arial and Times New Roman have two 'filled dot' characters. I recall that the Mac also has a tool for displaying all the characters available in a font.

 

Posts:26
Registered: 9/2/03
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Sep 3, 2003 7:25 AM (reply 2 of 24)



 
You will have to use Swing componens instead of AWT for that
 

Posts:4
Registered: 9/3/03
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Sep 3, 2003 7:34 AM (reply 3 of 24)



 
Thanks for the information,

so here is the long version:
(Update to the items you mentioned)
1) The Font is in the Windows Fonts Directory (WINGDING.TTF)
2) This has already happened and I have the Wingdings font in the array
(an extract from the output)
2003-09-03 15:56:36.071: Font 0: dialog dialog
2003-09-03 15:56:36.071: Font 1: dialog.bold dialog
2003-09-03 15:56:36.071: Font 2: dialog.bolditalic dialog
2003-09-03 15:56:36.071: Font 3: dialog.italic dialog
2003-09-03 15:56:36.071: Font 0: Verdana Verdana
...
2003-09-03 15:56:36.071: Font 0: Wingdings 2 Wingdings 2
...
2003-09-03 15:56:36.071: Font 0: Webdings Webdings
...
2003-09-03 15:56:36.087: Font 0: Wingdings Wingdings
...
2003-09-03 15:56:36.087: Font 0: Wingdings 3 Wingdings 3
...
3)As I already said. I also would prefer to take an other Font but for compability reasons it has to be this one...

Again thanks for your answer.

Regards
Guido Verse
 

Posts:4
Registered: 9/3/03
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Sep 3, 2003 7:37 AM (reply 4 of 24)



 
Is there a cause for using a swing component ?
(I'm writing it directly to the Surface of a JFrame in the moment so this should cover the need of a swing component.)
 

Posts:26
Registered: 9/2/03
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Sep 3, 2003 7:40 AM (reply 5 of 24)



 
I have encountered the same problem with textfield but the same thing was working fine in jtextfield
 

Posts:12
Registered: 2/18/03
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Sep 4, 2003 1:59 PM (reply 6 of 24)



 
Thanks for the information,

so here is the long version:

2) This has already happened and I have the Wingdings
font in the array

2003-09-03 15:56:36.071: Font 0: Wingdings 2 Wingdings
2
...
2003-09-03 15:56:36.071: Font 0: Webdings Webdings
...
2003-09-03 15:56:36.087: Font 0: Wingdings Wingdings
...
2003-09-03 15:56:36.087: Font 0: Wingdings 3 Wingdings

So it's definitely there. Does WingDings display at all? Or is just this character that's problematic?
I also had problems displaying a font that Java listed in the array. This occured in Java 1.3, and the problem vanished when I used 1.4.
 

Posts:4
Registered: 9/3/03
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Sep 5, 2003 3:49 AM (reply 7 of 24)



 
Hi,

No I have problems with every character in (it seems) all fonts of the symbol family.
(Until now I tried "Hello World ..." in Wingdings (1-3), Webdings, Symbol, and some other fonts).

I hope I will get the time to write a small test application this evening so anyone can compare my results with his own.

Regards
Guido Verse
 

Posts:1
Registered: 11/5/03
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Nov 7, 2003 1:43 PM (reply 8 of 24)



 
Did you ever figure out how to make this work? I've spent hours combing various forums looking for a way to display the symbol fonts in Swing controls.
 

Posts:31,095
Registered: 4/30/99
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Nov 7, 2003 2:58 PM (reply 9 of 24)



 
Although I haven't tried it, I'm pretty sure the answer is going to be "Use the correct Unicode value for the character you want to display." Here's a link to the Unicode code charts:

http://www.unicode.org/charts/

The charts you're interested in are at the top of the second column, I think.
 

Posts:7
Registered: 4/30/04
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Jul 13, 2004 5:35 PM (reply 10 of 24)



 
I got the same problem.
I have tried so many ways but no one can work.
can any one give me some idea?
 

Posts:8,813
Registered: 10/4/00
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Jul 13, 2004 5:47 PM (reply 11 of 24)



 
I haven't tried this, but there's a couple bugs which promise to be fixed in 1.5
http://onesearch.sun.com/search/developers/index.jsp?qt=wingdings&col=javabugs
 

Posts:8,813
Registered: 10/4/00
Re: Howto use Wingdings (or other Symbol f.) without squares being displayed ?  
Jul 13, 2004 5:47 PM (reply 12 of 24)



 
Oh yeah.... Do I get the dukes?
 

Posts:9,091
Registered: 8/15/01
Re: Howto use Wingdings (or other Symbol f.) without squares being displaye  
Jul 13, 2004 6:33 PM (reply 13 of 24)



 
I got the same problem.
I have tried so many ways but no one can work.
can any one give me some idea?

Follow DrClaps advice. The characters in the WingDings Font, exist as a char set as part of Unicode. Start up the "Character Map" application, select "Arial Unicode MS" as the font, "Unicode Subrange" as the "Group by" then "Symbols & Dingbats" as the Subrange.
Cllick on the symbol you want, you will then see a number at the bottom of the Character Map window U + XXXX (i.e. ♟ is U+265F, ✮ is U+272E) You can then use that number in a Java string:
String prawnStar = "\u265F\u272E";

If the above displays squares, then your default font for your web browser does not support a large enough subset of Unicode, I recomend you change it to something more complete ("Arial Unicode MS" is one of the most compele unicode fonts about). Java defaults (on every system I've used it on anyway) to using a font with a farily complete Unicode character set.
 

Posts:7
Registered: 4/30/04
Re: Howto use Wingdings (or other Symbol f.) without squares being displaye  
Jul 13, 2004 7:09 PM (reply 14 of 24)



 

Cllick on the symbol you want, you will then see a
number at the bottom of the Character Map window U +
XXXX (i.e. ♟ is U+265F, ✮ is U+272E) You
can then use that number in a Java string:
String prawnStar = "\u265F\u272E";
.....

Thank you for your information.
But I'm still not very sure.
Now I have a variable string (such as "abcde ddd 123sA" ) need to display in wingdings font (or other symbol font)
Do you mean i need set the encoding of this string?
or I need write a code convertor to this string before it can be displayed?

Can you give me more advice?
Thank you for your kindness!
 
This topic has 24 replies on 2 pages.    1 | 2 | Next »