通过Photoshop中的脚本更改特定文本的字体 [英] Change font for particular text via script in Photoshop

查看:259
本文介绍了通过Photoshop中的脚本更改特定文本的字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在查找用于更改段落中特定单词或文本的字体的脚本或动作.

我有多个.psd文件(超过80个),我需要在其中将特定文本的字体(例如"Hello")从Arial更改为Tahoma,并使其加粗.

真的很感谢您的帮助!

解决方案

您可以尝试使用堵塞"框架.有用于处理文本的类. http://www.tonton-pixel.com/JSON %20Action%20Manager/jsDoc/symbols/jamText.html 您正在寻找textStyleRange.

var text = "Bonjour !";
var layerText =
{
    "layerText":
    {
        "textKey": text,
        "textClickPoint": { "horizontal": 50, "vertical": 95 },
        "antiAlias": "antiAliasCrisp",
        "textShape":
        [
            { "textType": "point", "orientation": "horizontal" }
        ],
        "textStyleRange":
        [
            {
                "from": 0,
                "to": text.length,
                "textStyle":
                {
                    "fontPostScriptName": "Myriad-Italic",
                    "size": 288,
                    "color": { "red": 144, "green": 0, "blue": 255 }
                }
            }
        ],
        "paragraphStyleRange":
        [
            {
                "from": 0,
                "to": text.length,
                "paragraphStyle": { "alignment": "center" }
            }
        ]
    },
    "typeUnit": "pixelsUnit"
};
jamText.setLayerText (layerText);

您需要: -创建检查所有图层的循环 -读取一个文本层 -查找从哪个字符索引子字符串开始,在哪里结束 -应用jamText.setLayerText -阅读下一层

它也没有框架.结构是相似的.该代码将更难看.

Looking for a script or action for changing font face for a particular word or text in a paragraph.

I have multiple .psd files (80+) where I need to change font for a specific text say "Hello" from Arial to Tahoma and also make it bold.

Really appreciate a help!

解决方案

You could try "jam" framework. There is class for manipulating with text. http://www.tonton-pixel.com/JSON%20Action%20Manager/jsDoc/symbols/jamText.html You are looking for textStyleRange.

var text = "Bonjour !";
var layerText =
{
    "layerText":
    {
        "textKey": text,
        "textClickPoint": { "horizontal": 50, "vertical": 95 },
        "antiAlias": "antiAliasCrisp",
        "textShape":
        [
            { "textType": "point", "orientation": "horizontal" }
        ],
        "textStyleRange":
        [
            {
                "from": 0,
                "to": text.length,
                "textStyle":
                {
                    "fontPostScriptName": "Myriad-Italic",
                    "size": 288,
                    "color": { "red": 144, "green": 0, "blue": 255 }
                }
            }
        ],
        "paragraphStyleRange":
        [
            {
                "from": 0,
                "to": text.length,
                "paragraphStyle": { "alignment": "center" }
            }
        ]
    },
    "typeUnit": "pixelsUnit"
};
jamText.setLayerText (layerText);

You need: - create loop which checks all layers - read one text layer - find on which character index substring starts, where is end - apply jamText.setLayerText - read next layer

It goes also without framework. The structure is analogous. The code will be uglier.

这篇关于通过Photoshop中的脚本更改特定文本的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆