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);
}
}