Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetGlyphIndices reports glyph does not exist

166 views
Skip to first unread message

David Liebtag

unread,
Jan 31, 2006, 7:37:07 PM1/31/06
to
I am writing code to warn my users if they select a font that does not
contain characters used in our product. I'm using GetGlpyhIndicesW to
translate a string of Unicode characters into glpyh indices. This is
working fine except for a handful of fonts for which it is returning 0xFFFF
for Unicode codepoint U005F (which is the underscore character.)

The font developer swears the fonts contain this character and they
certainly seem to to me.

Can anyone suggest why GetGlyphIndices is indicating the fonts do not
contain this character?

Thank you.

David Liebtag


Kellie Fitton

unread,
Jan 31, 2006, 9:10:14 PM1/31/06
to
Hi,

Well, you should use the following APIs when appropriate to check
and see if the function call had failed or not, simply by checking
the returned code and respond accordingly:

GetLastError()
FormatMessage()

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/getlasterror.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/formatmessage.asp

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

Hope these information helps,

Kellie.

Mihai N.

unread,
Feb 1, 2006, 2:59:45 AM2/1/06
to
> I am writing code to warn my users if they select a font that does not
> contain characters used in our product. I'm using GetGlpyhIndicesW to
> translate a string of Unicode characters into glpyh indices. This is
> working fine except for a handful of fonts for which it is returning 0xFFFF
> for Unicode codepoint U005F (which is the underscore character.)
>
> The font developer swears the fonts contain this character and they
> certainly seem to to me.
It is true, in my experience GetGlpyhIndicesW is unable to properly handle
anything beyond BMP.
It is easy to prove the characters are there, just try displaying them (that
one works :-)
I had to write my own "IsGlpyhPresent" function, parsing the font tables.
Interesting experiment :-)

--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

David Liebtag

unread,
Feb 1, 2006, 9:41:30 AM2/1/06
to
The API is not failing. Rather, it is reporting that that there is no glyph
for that one character.

David Liebtag


David Liebtag

unread,
Feb 1, 2006, 9:43:08 AM2/1/06
to
I know the glyph is there; I can see it. But, I'm trying to write code to
do it. I don't have the expertise or resources to parse the font tables
myself. I guess I'm out of luck.

David Liebtag


Mihai N.

unread,
Feb 2, 2006, 3:36:05 AM2/2/06
to
> I know the glyph is there; I can see it. But, I'm trying to write code to
> do it. I don't have the expertise or resources to parse the font tables
> myself. I guess I'm out of luck.
No promise, but if i manage to clean the code enough, I will post it over the
week-end (check see my website below).
It was a "quick and dirty" test, just to see how complicated it is.
As a result, I only parse two table types (ones covering Unicode beyond BMP),
so it is not a full replacement. If I post it, I will also explain what I do.

David Liebtag

unread,
Mar 6, 2006, 1:25:32 PM3/6/06
to
FYI I discovered the error was in my code, not GetGlyphIndices.

David Liebtag
IBM APL products and Services


Chirag Sharma

unread,
May 29, 2014, 2:56:45 AM5/29/14
to
Hi David,

I am trying to use GetGlyphIndices to find out ligated glyphs in a string for Devanagari font.
Please help me with a sample code.
I am unable to understand the output of GetGlyphIndices. Also currently it is returning me the same value as the length of the passed string.

Thanks a lot.
Chirag Sharma.
0 new messages