tags:

views:

289

answers:

2

The standard windows Charmap utility shows quite a few characters in the "Wingdings 2" font whose character codes are greater than 255 - for example, 0xE4E shows a hand.

However, if I try to draw these characters as follows:

g.DrawString(new string((char) 0xE4E, 1), new Font("Wingdings 2", 20), brush, x, y);

then all I get is a standard "box" replacement character. This is weird, because the above code works for Wingdings 2 symbols between 0x21 and 0xFF, and also works for ALL symbols in, say, Arial Unicode MS.

How can I draw those characters from this particular font? Is there a separate API?

(Win7; .NET 3.5 SP1)


P.S. Here's the weird Character Map font with the duplicated character ranges:

charmap

+2  A: 

No, there is no special API, nor is the fonts special per se. Wingdings et al. just don't use the "expected" glyphs for the character codes

However, I don't see that character in Charmap with that character code for that font (Win 7). If you're thinking of the character I think you're thinking of, it's just 0x4E.

Wingdings 2 in Character Map

Michael Madsen
Hmm... you're right, it's the same character. My charmap seems to be showing the very same set of characters three times, under different ranges! I'm on the 64-bit Win7 by the way.
romkyns
-1 for your souless machine generated circles :(
Earlz
@Earlz: Sorry. Had this been Meta, you would have had the chance to bask in the glory that is my freehand circles. :)
Michael Madsen
+1  A: 

In my CharMap (Vista), WinDings 2 only goes as far as 0xFF

So your code is good, you (char)codes are in doubt.

Henk Holterman
I just realized those extra pens at the end of my are the same ones as 0x21 and 0x22. I think something's gone wrong with the font in Win7, because those extra pens shouldn't actually be there - and neither should the repetitions in romkyns image.
Michael Madsen
Yes, and even if they are valid in Win7 or x64, you'd still want to use the below 0xFF codes for compatibility
Henk Holterman