Known Participant
September 22, 2023
Answered
Getting different fontStyles in the document for the same font
- September 22, 2023
- 4 replies
- 1542 views
Hi Everyone,
I am trying to get fontStyle for the characters through scripting by the below code,
app.findGrepPreferences = changeGrepPreferences = NothingEnum.nothing;
app.findChangeGrepOptions.includeFootnotes = true;
app.findChangeGrepOptions.includeLockedLayersForFind = true;
app.findChangeGrepOptions.includeMasterPages = false;
app.findGrepPreferences.findWhat = ".";
var findss = app.activeDocument.findGrep();
for(j=0;j<findss.length;j++){
$.writeln(findss[j].characters[0].fontStyle)
}
but i am getting both 'book' fontStyle and 'Regular' for the different contents. I am using 'adobe caslon pro-regular' font.

I don't know what is wrong with the code or the font, file. Attached files for your reference.
Please help me to sort this issue.
Thanks,
SathishS
