I’m working on a localization plugin that translates text layers to a target language. Now that I have the ability to set text, our artists would like to also set the font with an adjustment in font size. My questions are:
- can I make a font selection dropdown with UXP so that one can easily select from currently available fonts;
- what attributes are required to set a new font to a layer? Alchemist gave me the following (the part I believe is relevant):
"textStyleRange": [
{
"_obj": "textStyleRange",
"from": 0,
"to": 12,
"textStyle": {
"_obj": "textStyle",
"styleSheetHasParent": true,
"fontPostScriptName": "ArialMT", //where do I get this?
"fontName": "Arial", //a dropmenu is needed to select the name and the style
"fontStyleName": "Regular", //I only know how to accept user input, but these names will be too much to remember
"fontScript": 0,
"fontTechnology": 1,
"fontAvailable": true,
"size": {
"_unit": "pointsUnit",
"_value": 10.753338813781738
},
"impliedFontSize": {
"_unit": "pointsUnit",
"_value": 23.99999973390979
}