Copy link to clipboard
Copied
Is it possible to set text type to bold italic via script? I have the following code that works:
app.activeDocument.activeLayer.textItem.font = "Arial";
What would I need to add to make it bold italic?
Thanks.
for(i = +(fnts = []); i < fonts.length;) {if (/bolditalic/i.test(fnt = fonts[i++].postScriptName)) fnts.push((fnts.length ? '\n' : '') + fnt)}; alert(fnts)
Copy link to clipboard
Copied
Arial-BoldItalicMT
Copy link to clipboard
Copied
What about other fonts? For example Courier New?
Copy link to clipboard
Copied
for(i = +(fnts = []); i < fonts.length;) {if (/bolditalic/i.test(fnt = fonts[i++].postScriptName)) fnts.push((fnts.length ? '\n' : '') + fnt)}; alert(fnts)
Copy link to clipboard
Copied
Set font manualy, then
alert(app.activeDocument.activeLayer.textItem.font)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now