0

I use CharacterToGlyphMap from GlyphTypeface

http://msdn.microsoft.com/en-us/library/ms635034.aspx

to get all characters include in any fonts. If I use e.g. Arial everything is right, but for some fonts I get wrong code points.

For example for Ebrima I get some code points beyond of the scope of Unicode. The last character in Ebrima font is hex: FD3F (dec: 64831), but CharacterToGlyphMap contains a few additional values, e.g. (dec: 66688, 66689, 66690...). What could be the reason of wrong code points for above example?

Edit:

I implement my own character map and for some fonts my application crash, because I use

Convert.ToChar(unicodeCodePoint)

The solution for this problem is to limit the use of characters (thanks for @AakashM) e.g.

foreach (KeyValuePair<int, ushort> item in glyphTypeface.CharacterToGlyphMap)
{
   if (item.Key >= Char.MinValue && item.Key <= Char.MaxValue)
   {
      limitedCharacterMap.Add(item.Key, item.Value);
   }
}
rgb
  • 1,750
  • 1
  • 20
  • 35
  • What's your source for your statement "The last character in Ebrima font is hex: FD3F" ? (note that [Windows Character Map only supports the BMP](http://stackoverflow.com/questions/9755498) ) – AakashM Dec 05 '12 at 10:32
  • What do you mean with "beyond of the scope of Unicode"? Unicode does not stop at U+FFFF. – Sebastian Negraszus Dec 05 '12 at 10:34
  • I create character map so I based on the built-in Windows. Thanks for the reply AakashM. Sebastian Negraszus you're right, my mistake. – rgb Dec 05 '12 at 10:42
  • @rgb add an answer explaining what you did and what you saw, it may help someone in the future. – AakashM Dec 05 '12 at 10:56

0 Answers0