PDA

View Full Version : [Solved] Detect placeholder characters



Nitrogen
04-02-2007, 11:23 PM
I'm busy adding unicode support to my Font Studio program, and I have a list of all 65536 characters available to use from the unicode set but most of the characters are not supported by the current font and just show that square placeholder thing. I'd like to show only those characters which are supported by the current font.

Now, how do I detect whether a character is supported by the current font or if it's not (ie. shows the placeholder character when printed)?

I've done some googling, but nothings turned up yet...

I'm using TextOutW() to display the character.

Nitrogen
04-02-2007, 11:35 PM
Ok, after some creative googling, I found some functions which will tell me what I need to know:

GetFontUnicodeRanges (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_2alv.asp)

and

GetGlyphIndices (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_4svn.asp)

will both tell you whether a font supports a specific character or not.