今天才看到,抱歉拖了这么久。
您可以尝试为此使用 unicode 代码。请参阅此页面上的表格:
https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts
但那些字符肯定很小!有可用的字母字符代码,但我没有测试任何代码。这是一些要测试的代码,带有注释:
function buildUI(this_obj_) {
var win = (this_obj_ instanceof Panel)
? this_obj_
: new Window('palette', 'Script Window',[147,196,528,330]);
// \u00B2 for super 2, \u00B3 for super 3; the rest are \u2070 for super zero, \u2071 for super one, \u2074 for super four, \u2075 for super five, etc...
win.xui_ui_button5 = win.add('button', [49,24,177,54], 'Super\u00B2');
win.xui_ui_button5.onClick = function () {this.parent.close(1);}
// \u2081 for sub 1, \u2082 for sub 2, \u2083 for sub 3, etc...
win.xui_ui_button6 = win.add('button', [49,65,177,95], 'Sub\u2082');
win.xui_ui_button6.onClick = function () {this.parent.close(1);}
return win
}
var w = buildUI(this);
if (w.toString() == "[object Panel]") {
w;
} else {
w.show();
}
[编辑:这是此代码在 After Effects 中创建的调色板窗口的屏幕截图]
[编辑 2:这是使用模式对话框在 Photoshop 中工作的代码(我正在这台机器上测试旧版本的 PS,但它应该可以工作,但在最新版本上看起来不同]
var win = new Window('dialog', 'Script Window',[670,456,1160,598]);
var w = buildUI();
if (w != null) {
w.show();
}
function buildUI() {
if (win != null) {
win.xui_ui_button5 = win.add('button', [64,11,231,51], 'Super\u00B2');
win.xui_ui_button5.onClick = function () {this.parent.close(1);}
win.xui_ui_button6 = win.add('button', [264,63,431,103], 'Sub\u2082');
win.xui_ui_button6.onClick = function () {this.parent.close(1);}
}
return win
}
这是在 PS 中工作的超级 x、y 和 z,使用代码 \u02E3、\u02B8 和 \u1DBB: