Discussion:
GetGlyphIndices reports glyph does not exist
(too old to reply)
David Liebtag
2006-02-01 00:37:07 UTC
Permalink
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
2006-02-01 02:10:14 UTC
Permalink
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.
David Liebtag
2006-02-01 14:41:30 UTC
Permalink
The API is not failing. Rather, it is reporting that that there is no glyph
for that one character.

David Liebtag
Mihai N.
2006-02-01 07:59:45 UTC
Permalink
Post by David Liebtag
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
2006-02-01 14:43:08 UTC
Permalink
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.
2006-02-02 08:36:05 UTC
Permalink
Post by David Liebtag
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.
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
David Liebtag
2006-03-06 18:25:32 UTC
Permalink
FYI I discovered the error was in my code, not GetGlyphIndices.

David Liebtag
IBM APL products and Services
Chirag Sharma
2014-05-29 06:56:45 UTC
Permalink
Post by David Liebtag
FYI I discovered the error was in my code, not GetGlyphIndices.
David Liebtag
IBM APL products and Services
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.

Loading...