【问题标题】:Add Drop Shadow to text将阴影添加到文本
【发布时间】:2011-06-24 08:19:20
【问题描述】:

如何使用 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; 

【问题讨论】:

    标签: photoshop jsx photoshop-script


    【解决方案1】:

    我相信没有用于此的 API 函数。 你能做的最好的就是使用Scriptlistner。 然后它生成的代码可以在您的脚本中使用。

    这里有一些与 Scriptlistner 生成的代码类似的讨论:

    http://ps-scripts.com/bb/viewtopic.php?t=586

    http://ps-scripts.com/bb/viewtopic.php?t=2207

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-04
      • 1970-01-01
      相关资源
      最近更新 更多