用于在 Photoshop 中的位图图像中创建文本的 Photoshop 脚本
Photoshop Script to create text in a bitmap image in Photoshop
我有非常大的 1 位图像,我需要在 Photoshop 中写入文本数组。 我可以在javascript中通过将图像转换为灰度,然后为每个文本块创建一个新层来执行此操作,但我希望能够将文本直接写入1位位图以节省时间。 有没有办法在javascript中做到这一点?
您可以使用脚本创建文本。您需要处于灰度(或 RGB(才能执行此操作。这是一个基本的文本函数。您必须在创建文本后定位文本,因为在创建文本之前无法获取其大小。希望这有帮助。
createText("Arial-BoldMT", 48, 0,128,0, "Hello World", 100, 50)
activeDocument.activeLayer.name = "Text";
activeDocument.activeLayer.textItem.justification = Justification.CENTER
function createText(fface, size, colR, colG, colB, content, tX, tY)
{
// Add a new layer in the new document
var artLayerRef = app.activeDocument.artLayers.add()
// Specify that the layer is a text layer
artLayerRef.kind = LayerKind.TEXT
//This section defines the color of the hello world text
textColor = new SolidColor();
textColor.rgb.red = colR;
textColor.rgb.green = colG;
textColor.rgb.blue = colB;
//Get a reference to the text item so that we can add the text and format it a bit
textItemRef = artLayerRef.textItem
textItemRef.font = fface;
textItemRef.contents = content;
textItemRef.color = textColor;
textItemRef.size = size
textItemRef.position = new Array(tX, tY) //pixels from the left, pixels from the top
}
相关文章:
- 如何使用jquery在填充自动完成的值后使文本框只读
- 使用Clipboard.js复制span文本
- 使用JS如何动态更改显示的html文件中的文本背景颜色
- 用程序搜索JQuery数据表中的文本
- 查找并替换多个Photoshop文件中的文本
- Photoshop Javascript-试图创建新的文本层时出现语法错误
- Photoshop 脚本将一个文本一个接一个地放置
- 用于在 Photoshop 中的位图图像中创建文本的 Photoshop 脚本
- 通过 Javascript 在 Photoshop CS6+ 中格式化文本
- Photoshop 脚本 - 如何在一种历史记录状态下创建文本图层
- Photoshop脚本删除所有文本层
- 使用Photoshop脚本(.jsx)附加到现有文本文件
- 使用Javascript在Photoshop中编辑文本层的内容
- 寻找一个photoshop脚本添加文本到图像和调整大小以适应
- 添加和转换图层的图像和文本,如Photoshop fx
- 服务器端预处理器为脆漂亮的字体/文本,如在photoshop
- 输出阿拉伯语/泰语文本在Excel文件中使用Photoshop JavaScript
- 如何通过Photoshop JavaScript将文本写入文本文件
- Photoshop 脚本:更改文本图层的文本
- Javascript Photoshop:用于更改现有文本图层的文本颜色的语法