Site logo

Kerning

Kerning regards insertion points between characters, so you'll usually get in trouble when targeting either the first or the last insertion points of a Story. When the kerningMethod is automated (as 'Optical' or 'Metrical') kerning values have a default amount which you can read using myInsertionPoint.kerningValue, but this command fails if the insertion point index is 0 (zero) or the last index in the Story. You then get the "property is not applicable in the current state" error.
Anyway you can override kerning values:
myText.insertionPoints.everyItem().kerningValue = 50;
or even
myText.kerningValue = 50; // all underlying insertion points are targeted as well
Interestingly, such command allows to apply the overriding value to both the first and last insertion point (although this has no visual effect).
And then myText.insertionPoints[0].kerningValue
does not lead to a runtime error and actually returns the value (50).