Copy link to clipboard
Copied
What I want to do:
Change a specific character to it's alternate glyph.
What I have been trying:
var myDoc = app.activeDocument;
//get the text frame
var tf = myDoc.textFrames[0];
//change the size of a specific character
tf.textRange.characters[0].characterAttributes.size = 36;
//try and change the specific character to it's alternate style
tf.textRange.characters[0].characterAttributes.stylisticAlternates = true;
Where I am currently:
-I can access a specific character and tested that by changing it's size which works.
-I am unable to change that character to it's alternate glyph.
-I have also tried messing aroound with "AlternateGlyphsForm" to no avail.
Question:
Does anyone know how to change a text item to it's alternate font glyph via javascript?
Thank you
Copy link to clipboard
Copied
What kind of Alternate glyph are you working with? can you show samples?
Copy link to clipboard
Copied
Hi CarlosCanto thank you for your reply.
Please excuse me if I am misusing terms, but I am essentially trying to swap the "L" here for it's alternate but I need to do so programatically.
Copy link to clipboard
Copied
I don't think there is a command to swap the alternates. I understand you just posted a random sample but on your real project, check the Open Type Panel for changes. If one of the circled icons highlights when you swap the available glyphs by hand, it might be possible to change it with javascript.
In the example below, if the alternate glyph is an Ordinal, the "1st" icon will highlight.
in javascript it will be the same as
selection.characterAttributes.ordinals = true;
Copy link to clipboard
Copied
All of the options in my Open Type panel are grey'd out sadly.
I've sort of run out of options at this stage for new things to try so perhaps just have to abandon this idea.
Thank you for your help anyway.