Thread View: adobe.scripting.indesign
2 messages
2 total messages
Started by stevejenks
Fri, 13 Feb 2009 00:00
Maori Macrons: CS3
Author: stevejenks
Date: Fri, 13 Feb 2009 00:00
Date: Fri, 13 Feb 2009 00:00
13 lines
1674 bytes
1674 bytes
Hi 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. Steve
Re: Maori Macrons: CS3
Author: Peter Kahrel
Date: Fri, 13 Feb 2009 06:19
Date: Fri, 13 Feb 2009 06:19
34 lines
1898 bytes
1898 bytes
Steve,
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;
}
}
Peter
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads