🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.photoshop.scripting
3 messages
3 total messages Started by Goydo_deKnirk Mon, 23 Mar 2009 20:17
how to use FONTNAMES
#233
Author: Goydo_deKnirk
Date: Mon, 23 Mar 2009 20:17
17 lines
1088 bytes
Hi,

I wonder how to get the real name of a font for using in a script.
(sorry for bad english, i am deutsch:-)

In my Fonts folder, there is a file "Eurostib.TTF".
The file discription is "Eurostile Fett (True Type)".
In Photoshop I can select "Eurostile" "Bold".

But in a script I have to use "EurostileBold". This works.

This I discovered by accident. Now I try to use other fontnames
but Photoshop does not understand any name.

app.activeDocument.layerSets[i].layers[j].textItem.font = "HelveticaNarrow"

How does this work?
Re: how to use FONTNAMES
#235
Author: Paul_R
Date: Mon, 23 Mar 2009 20:26
61 lines
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(); 
Re: how to use FONTNAMES
#245
Author: Goydo_deKnirk
Date: Tue, 24 Mar 2009 12:31
1 lines
643 bytes
This is very helpfull. I am thrilled! Thanks a lot! :-)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads