R. Martinho Fernandes
R. Martinho Fernandes

Reputation: 234514

How can I get the glyph that was set manually for a given character?

I can use the Glyphs panel to use a character with a manually chosen alternative glyph. But how can I then retrieve that glyph ID programmatically?

Example of picking an alternate glyph

I am currently using IDrawingStyle::GetSpecialGlyph, but it only works if the underlying character does not have a Unicode representation. But, say, if I drop some alternate glyph for the character U+0041 ʟᴀᴛɪɴ ᴄᴀᴘɪᴛᴀʟ ʟᴇᴛᴛᴇʀ ᴀ in a document using the Glyphs panel, the underlying character will be U+0041, so IDrawingStyle::GetSpecialGlyph will not work. How can I programmatically retrieve that glyph ID?

Upvotes: 7

Views: 666

Answers (1)

R. Martinho Fernandes
R. Martinho Fernandes

Reputation: 234514

You can get this by navigating the wax. Iterate the wax strand with CallbackWaxIterator, and then, for each wax run boss on a wax line, obtain the IWaxGlyphs interface and use PeekGlyphArray or MapCharsToGlyphs in combination with GetGlyphAt.

Upvotes: 3

Related Questions