tags:

views:

30

answers:

1

When working with different fonts, some might support, say, arabic characters where another might not.

Is there a way in C# to figure out what character ranges are supported by a specific font?

+3  A: 

You would need to P/Invoke GetFontUnicodeRanges(). Not easy to do because the font needs to be selected in the device context, that requires more p/invoke.

But most of all, it isn't the right thing to do. You should rely on Windows' automatic font linking, it finds another font if necessary to supply the glyph. The feature is described in this article.

Hans Passant
+1, that is a great article. Very useful!
Otaku
+1. Thanks for the help. You make a good point, in this case we aren't using the font in windows which is why we need to know.
Steve Sheldon