0 Replies Latest reply on Jan 5, 2012 6:42 AM by RF2009

    [JS CS4/CS5] Number of text style ranges changes when entering new text. Kerning

    RF2009 Level 1

      Hi all


      My problem is that we have encountered a few documents that seem to change the number of text style ranges in a text frame when adding text to a text style range, even though no new style is introduced.

      Deleting text does not change the number of styles.

      Copying text from the same text box and inserting somewhere else inside the text frame does not change the text style count either.


      I have created a document that duplicates the problem. Download it if you wish to examine it closer. It's a zipped INX file.




      The problem is related to the Kerning value currently set to Optical for the text frame in question. Changing the paragraph style in use to Kerning=None relieves the problem.


      Normally, using the optical kerning does not expose this behavior.


      My question is, why is this particular text frame causing this problem? What combination of style attributes is the problem here?


      The code that adds text to a given text style range is not really the issue here because you can encounter the problem in the client directly by simply typing a char into the text frame in question.


      In the InDesign document it self, I have described how to duplicate the problem.


      To count the text style ranges in the text frame use this script:


      var indoc = app.documents[0];
      var obj = indoc.selection[0];
      if(obj == null) { alert(“NO SELECTION”); exit(); }
      alert(“Total textstyle ranges: “ + obj.textStyleRanges.length);


      Turning on all Composition values in the preferences section highlights the problematic areas (when entering new text that is).


      Thanks in advance,