Release Notes > 12.1.1.0 > Updates in This Release > Kerning and OpenType Shaping > Finding Glyphs
  
Finding Glyphs
In this topic we have discussed glyph IDs quite a bit. However, it is not always easy to find the correct glyph IDs being returned by the OpenType shaping. For example, a font might have several very similar looking glyphs for a diacritic which will make it difficult to identify which one to apply shift values to. With this in mind, Layout Developer 12.1.1.0 now provides a new method for the fTypeface object to return an array of glyph IDs for a given string which is shaped according to specified feature tables, script and language properties.
The fTypeface.shapedGlyphs() method can be used as follows:
var tf = formatting.currentStyle.typeface;
var word = "difficult";
var outputGlyphs = tf.shapedGlyphs(word, "+kern,+liga,+dlig");
This might return an array like this (depending on the font being used):
[69,74,267,68,86,77,85]
where glyph ID 267 represents the ‘ffi’ ligature in the font.
The script and language arguments are optional, but please examine the font to ensure the feature tables you are expecting to be applied are applied for the currently active script and language values. The OpenType library shipped with Layout Developer provides a tool for this.
The values returned in the array can then be used together with the fFormatting.outputGlyphs() method to see those glyphs output on the page to ensure the correct shaping has been applied.