2011-06-24 132 views
1

如何使用Photoshop腳本添加陰影(具有定義的距離,大小等)?將陰影添加到文本

當前JS代碼

var fontSize = 14; 
var fontName = "Arial-Bold"; // NB: must be postscript name of font! 
// This is the colour of the text in RGB 
//Click foreground colour in Photoshop, choose your colour and read off the RGB values 
//these can then be entered below. 
var textColor = new SolidColor(); 
     textColor.rgb.red = 255; 
     textColor.rgb.green =255; 
     textColor.rgb.blue = 255; 

var newTextLayer = doc.artLayers.add(); 
newTextLayer.kind = LayerKind.TEXT; 
newTextLayer.textItem.size = fontSize; 
newTextLayer.textItem.font = fontName; 
newTextLayer.textItem.contents = ++Count; 
newTextLayer.textItem.color = textColor; 
newTextLayer.textItem.kind = TextType.PARAGRAPHTEXT; 
newTextLayer.textItem.height = fontSize; 
newTextLayer.textItem.width = doc.width -20; 
//The line below is the text position (X Y) IE; 10 Pixels Right 10 Pixels Down 
newTextLayer.textItem.position = Array(10, 12); 
// Can be RIGHTJUSTFIED LEFTJUSTIFIED CENTERJUSTIFIED 
newTextLayer.textItem.justification=Justification.CENTERJUSTIFIED; 

回答