fontStyle script
I want a script that automatically shows every kind of styles a font has.
Here is the script I have written, but it is stuck at the first fontStyle.
Please help me with how to modify it to show all styles.
I want to make it like the attached image.
var doc = app.activeDocument;
var fontname = app.fonts.item("Amandine").name;
var fontStyles = app.fonts.item("Amandine").fontStyleName;
var fontStylelist = [];
var title = doc.textFrames.add();
var styKind = doc.textFrames.add();
title.properties = {
contents : fontname.split("\t")[0],
geometricBounds : [15,15,60,195],
parentStory : {
pointSize : 72,
appliedFont : fontname,
fillColor : "Black",
fontStyle : "Bold"
}
}
styKind.properties = {
geometricBounds : [60,15,150,195],
parentStory : {
pointSize : 30,
appliedFont : fontname,
fillColor : "Black",
}
}
for (var i = 0; i < fontStyles.length; i++){
fontStylelist.push(fontStyles[i].name);
styKind.contents = fontname.split("\t")[0] + '\t' + fontStylelist[i];
fontStylelist[i].fontStyle = "fontStyles[i]";
}
