Article View: adobe.photoshop.scripting
Article #235Re: how to use FONTNAMES
From: Paul_R
Date: Mon, 23 Mar 2009 20:26
Date: Mon, 23 Mar 2009 20:26
61 lines
1879 bytes
1879 bytes
You need the postscript name of the font.
#target photoshop
var Dlog =
"dialog{text:'Script Interface',bounds:[100,100,500,270],"+
"FontName:DropDownList{bounds:[30,40,370,60]},"+
"PostScriptName:DropDownList{bounds:[30,100,370,120]},"+
"statictext0:StaticText{bounds:[40,10,200,30] , text:'Font Name'},"+
"statictext1:StaticText{bounds:[40,70,141,87] , text:'Postscript Name'},"+
"button0:Button{bounds:[140,130,240,150] , text:'Ok' }}";
win = new Window(Dlog,"Use the Postscript Name in your script.");
var item;
var item2;
for (var i=0,len=app.fonts.length;i<len;i++) {
item = win.FontName.add ('item', "" + app.fonts[i].name);
item2 = win.PostScriptName.add ('item', "" + app.fonts[i].postScriptName);
};
win.FontName.selection = win.FontName.items[0] ;
win.PostScriptName.selection = win.PostScriptName.items[0] ;
win.FontName.onChange = function() {
win.PostScriptName.selection = win.PostScriptName.items[parseInt(this.selection)] ;
$.writeln(win.PostScriptName.items[parseInt(this.selection)]);
};
win.PostScriptName.onChange = function() {
win.FontName.selection = win.FontName.items[parseInt(this.selection)] ;
};
win.center();
win.show();
Technical Details
Message-ID:
<59b8630c.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossingReferences:
<59b8630c.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,7c91ae0f09b6b078 X-Google-Attributes: gidf5839,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Paul_R@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.photoshop.scripting Subject: Re: how to use FONTNAMES Message-ID: <59b8630c.0@webcrossing.la2eafNXanI> Date: Mon, 23 Mar 2009 13:26:59 -0700 References: <59b8630c.-1@webcrossing.la2eafNXanI> Lines: 39 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit