我的字体不断恢复为“新罗马新罗马”。但是我设定了“大都市”在脚本中

发布于 2025-02-01 22:00:17 字数 1288 浏览 2 评论 0原文

var parent = app.project.activeItem;

for(var i = 0; i < parent.layers.length; i++){
        var mySourceText = parent.layer(i + 1).property("ADBE Text Properties").property("ADBE Text Document");
        var textProp = parent.layer(i + 1).property("Source Text");
        var currentValue = textProp.value;
        if(currentValue.toString().match(/[a-z]/i)){
            currentValue.font = "Bodoni-BoldMT";
            currentValue.fontSize = 125;
            textProp.setValue(currentValue);
            $.writeln("alpha hai ", currentValue)
        }else if(currentValue.toString().match(/[0-9]/i)){
            var myTextDoc = mySourceText.value;
            myTextDoc.fontSize = 100;
            myTextDoc.font = "Metropolis-Bold";
            myTextDoc.fillColor = [0.5,0.5,0];
            mySourceText.setValue(myTextDoc);  
            $.writeln("number hai ", currentValue)
        }else if(currentValue.toString().match(/[+\-=]/i)){
            currentValue.font = "Times New Roman";
            $.writeln("Arrtmathic hai ", currentValue)
        }else{
           $.writeln("Missed ", currentValue)
        }
}
var parent = app.project.activeItem;

for(var i = 0; i < parent.layers.length; i++){
        var mySourceText = parent.layer(i + 1).property("ADBE Text Properties").property("ADBE Text Document");
        var textProp = parent.layer(i + 1).property("Source Text");
        var currentValue = textProp.value;
        if(currentValue.toString().match(/[a-z]/i)){
            currentValue.font = "Bodoni-BoldMT";
            currentValue.fontSize = 125;
            textProp.setValue(currentValue);
            $.writeln("alpha hai ", currentValue)
        }else if(currentValue.toString().match(/[0-9]/i)){
            var myTextDoc = mySourceText.value;
            myTextDoc.fontSize = 100;
            myTextDoc.font = "Metropolis-Bold";
            myTextDoc.fillColor = [0.5,0.5,0];
            mySourceText.setValue(myTextDoc);  
            $.writeln("number hai ", currentValue)
        }else if(currentValue.toString().match(/[+\-=]/i)){
            currentValue.font = "Times New Roman";
            $.writeln("Arrtmathic hai ", currentValue)
        }else{
           $.writeln("Missed ", currentValue)
        }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风吹过旳痕迹 2025-02-08 22:00:18

在我看来,字体名称拼写错误。尝试先设置必要的一个,然后从中拔出所有正确的值。

it seems to me that the font name is spelled incorrectly. try to set the necessary one first and pull out all the correct values from it.
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文