1 Reply Latest reply on Feb 12, 2009 10:19 PM by Peter Kahrel

    Maori Macrons: CS3


      I'm working through a few documents at the moment that have a large number of Maori Macrons in the text and I'm wondering if there is a way of scripting the action of kerning the macron back to above the character. I'm thinking of something similar to the 'proper fractions' script I guess.

      Every font I am using has the macron character (Unicode 00AF, or opt+shift+,) but it is on its own rather than placed above the character.

      What I am doing at present is typing the macron character immediately after the letter it belongs with and then kerning it back - to about -360! I then have to add a little to the right of the original letter to stop it being too tight on the next letter. For example the word Maori has a macron over the 'a', so I type "Ma" then the macron, then "ori" and then kern it back.

      As you can imagine this is quite time consuming. I did consider getting someone to modify the font to include extra macron characters, but it makes more sense to me to explore scripting first as presumably a successful solution could then be applied to any font.

      Any input would be much appreciated.

        • 1. Re: Maori Macrons: CS3
          Peter Kahrel Adobe Community Professional & MVP

          Most fonts that ship with inDesign have the vowels+macron built in, so if those typefaces are ok with you (Minion, Arno, Sabon, etc.), that's the easiest solution.

          If the font you want to use doesn't contain the characters you need, then it's better to add them somehow rather than kerning base characters and floating accents together: it's more precise, quicker, and less error-prone. FontLab have a good font editor for this, TypeTool (http://www.fontlab.com/font-editor/typetool/, US$ 99). You can't change letter shapes with it (for that you need its big brother, Studio), but for your purposes it's fine.

          If you still want to script this in CS3, here are the basics:

          app.findChangeTextOptions.wholeWord = false;
          app.findChangeTextOptions.caseSensitive = true;
          app.findChangeTextOptions.includeFootnotes = true;

          app.findTextPreferences = null;

          kern ("a\u00AF", -360, 20);
          kern ("e\u00AF", -340, 10);
          // Enter more pairs here

          function kern (pair, kern_value_1, kern_value_2)
             app.findTextPreferences.findWhat = pair;
             var f = app.activeDocument.findText();
             for (var i = 0; i < f.length; i++)
                f[i].insertionPoints[1].kerningValue = kern_value_1;
                f[i].insertionPoints[2].kerningValue = kern_value_2;