Skip to main content
Known Participant
August 6, 2013
Answered

Ligatures

  • August 6, 2013
  • 1 reply
  • 1082 views

I have some code in an InDesign plug-in that iterates through all glyphs in a font and extracts the unicode value for the glyph by calling glyphUtils->GlyphToCharacter(font, glyph, &userAreaChar)

For the majority of glyphs there is a unicode value telling me which character this glyph represents. I am now working with Devanagari fonts where there are many glyphs which are Ligatures of combinations of many Devanagari unicode characters. Is there any way I can do a reverse lookup to find out which unicode characters, when combined, produces this glyphID?

Do I have to use glyphUtils->GetOTFAttribute and iterate through it to find which combination of unicode characters result in a particular glyphID? And what parameters should I use for GetOTFAttribute to get the ligature table?

This topic has been closed for replies.
Correct answer Pickory

Hello,

Have you had a look at:

SnpInsertGlyph::InsertGlyph

P.

1 reply

Known Participant
August 8, 2013

As I have had no reply to the above, perhaps I should phrase the question differently. I have a series of GlyphIDs in a font called Devanagari MT which represent the ligatures of combined Devanagari unicode characters. How do I add a glyphID into an ITextModel without the glyph having a unicode value. All I have is either

ITextModel::Insert(TextIndex start, const WideString* data, const ILanguage *language = nil )

or


ITextModelCmds::InsertCmd(TextIndex position, const boost::shared_ptr<WideString>& data, const ILanguage *language = nil)

Notice how both of these commands require a unicode WideString rather than Glyphs. InDesign can do this as you can go to the Glyphs palette and insert an alternate glyph. Is there a way I can insert a unicode character and then assign an alternate glyph ID to the unicode char maybe?

PickoryCorrect answer
Legend
August 8, 2013

Hello,

Have you had a look at:

SnpInsertGlyph::InsertGlyph

P.

Known Participant
August 8, 2013

Thank you. This looks like just what I am looking for :-)