3 Replies Latest reply on Jun 20, 2015 11:18 AM by arifk30354064

    How to optically kern between spaces?

    arifk30354064

      Hi, all!

      I am a typographer that frequently works with different Urdu fonts. I have recently developed many ligature based Nastaleeq fonts which work great in InDesign. However, I am having some serious trouble with InDesign's optical kerning feature that works as expected between the words but fails between the spaces. Have a look at these snapshots I have taken on the issue:

      Optical Kerning Turned Off:

      b501.gif

      Optical Kerning Turned On:

      b502.gif

      Optical Kerning Turn On with Space between the Words:

      b503.gif

      You see, Nastaleeq script is cursive in nature and has no need for spaces as we are accustomed to with most fonts. So my question to the experts here is how do I get optical kerning between the words despite the spaces? Is there any way I can make InDesign ignore the space or replace it with some other character that optically kerns between two words, ignoring the space in between? Thanks!

       

      Message was edited by: arif karim

        • 2. Re: How to optically kern between spaces?
          Laubender Adobe Community Professional & MVP

          Hi Arif,

          I'm really no expert in Nastaleeq script.

          My first idea is:

           

          Substitute all spaces with two special characters:

           

          1. A DISCRETIONARY_HYPHEN special character where the formatting of this special character should be no fill and no stroke.

          2. A ZERO_WIDTH_NONJOINER special character

           

          The formatting could be done with a GREP Style, the substitution with a Search/Replace action or by script.

          Optically this could work, but may bear sideeffects, if you export to XML, HTML or EPUB.

           

          To test this out, just select one single space between two words and run the following ExtendScript (JavaScript) script snippet:

           

          //Select a space between two words:
          var myStory = app.selection[0].parentStory;
          var myIndex = app.selection[0].insertionPoints[0].index;
          
          //Insert two special characters:
          myStory.insertionPoints[myIndex].contents = SpecialCharacters.DISCRETIONARY_HYPHEN;
          myStory.insertionPoints[myIndex+1].contents = SpecialCharacters.ZERO_WIDTH_NONJOINER;
          
          
          //Remove the selected space:
          myStory.characters[myIndex+2].remove();
          
          //Format the DISCRETIONARY HYPHEN:
          myStory.characters[myIndex].fillColor = "None";
          myStory.characters[myIndex].strokeColor = "None";
          

           

          I tested this script with some Arabic dummy text in InDesign CS6 (German) where I replaced all spaces.

           

          Before/After showing no hidden characters:

          Before-After-ShowingNoHiddenCharacters.png

           

          Before/After showing all hidden characters:

          Before-After-ShowingHiddenCharacters.png

           

           

          Used font is Adobe Arabic, language is Arabic.

          With that font and the used words (I really have no idea what they are saying, if anything at all) this procedure is pure nonsense, I think


          But in your case it may be useful:

          Optically there will be no space between the words and hyphenation is still working.

          Permanent overset should be prevented through the descretionary hyphen where its fill and stroke is set to none and therefore will be invisible, if hyphenation is done.

           

          Uwe

          • 3. Re: How to optically kern between spaces?
            arifk30354064 Level 1

            Thank you Laubender

            It fixed my problem. Big thanks!

             

            And now I have another issue, if you can help me out here:
            Optical Kerning is not working for Arabic fonts!