我的字体不断恢复为“新罗马新罗马”。但是我设定了“大都市”在脚本中
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,字体名称拼写错误。尝试先设置必要的一个,然后从中拔出所有正确的值。
态
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