Copy link to clipboard
Copied
this is my script blow:
var textItemRef = app.activeDocument.activeLayer.textItem;
var fonts = app.fonts;
for(var i = 0; i < fonts.length; i++){
var fontName = fonts[i].postScriptName;
textItemRef.font = fontName;
}
i`m trying to set every font installed, but some font(most of them) are set failed(without any changing),is any script i wrote wrong,thanks for any help!
thanks for your replay, i find out what the problem is, if textItem contens is not support the font i trying to set, then the action will be fail!
Copy link to clipboard
Copied
Without actually testing this, most fonts are no longer postscript. Does just using font(i).name work?
Copy link to clipboard
Copied
thanks for your replay, i find out what the problem is, if textItem contens is not support the font i trying to set, then the action will be fail!
Copy link to clipboard
Copied
Hi,
I tried your script, each and every fonts work. May be some of the fonts are different from you. Could you please let us know some of fonts name which are not working at your end?
Copy link to clipboard
Copied
i fixed the problem, my textItem contens not support some font, so the action failed