What error do you get?
error code 511
Invalid font style
You set the font style to an empty string.
Look up the three arguments of the newFont() method:
Did not test this, but how about:
ScriptUI.newFont ("Brush Script Std", "Medium", 14)
nope.. it doesn't work.
Error code: 511 Invalid font style 'Medium'
Then I tested with the predefined string "REGULAR":
ScriptUI.newFont("Brush Script Std", "REGULAR", 14);
InDesign CS6 on OSX 10.10.5.
does not work for me, still getting the same error.
contr.graphics.font = ScriptUI.newFont("Brush Script Std", "REGULAR", 14); // This will give error
contr.graphics.font = ScriptUI.newFont ("Times New Roman", "BoldItalic", 12); // This is OK
Really don't understand where the problem lies as i do have Brush Script Std font. (sigh)
tested this with a script snippet by Peter Kahrel's scriptui-2-13-f-2017.pdf page 40.
Where I simply changed this line:
headers.children[i].graphics.font = ScriptUI.newFont ("Arial", 'BOLD', 12)
To that one:
headers.children[i].graphics.font = ScriptUI.newFont ("Brush Script Std", "REGULAR", 14)
Here a screenshot from InDesign CS6 v8.1.0 on Mac OSX 10.7.5:
Ok. This is not working as expected with InDesign CC 2017 on Mac OSX 10.7.5.
No error message but the wrong result. As you can see, Brush Script Std. is installed and available with InDesign CC 2017.
It is as if the font is not recognized and ScriptUI is doing a default font.
Here some more information, but maybe outdated a bit for CC 2017:
I tried Marc's trick by using the PostScript name of the font:
app.fonts.item("Brush Script Std Medium").postscriptName; // Result: BrushScriptStd
But had no luck with CC 2017 on Mac OSX 10.10.5.
What is your version of InDesign and OS?
This notation is working on OSX 10.10.5 with CS6,
but not with CC 2017 , CC 2015.4.1 , CC 2014.2 and CC v9.3.0.
Same result as CC 2017. The right font is not showing. Instead it fails silently and is showing a default font:
headers.children[i].graphics.font = "Brush Script Std:14";
Using the PostScript font name throws no error in this notation on OSX with CS6 and CC 2017,
but ScriptUI fails silently and defaults to a standard font with both versions of InDesign:
headers.children[i].graphics.font = "BrushScriptStd:14";
For Windows the results could be quite different.
Depending on used font and version of InDesign.
2 people found this helpful
Ahem. I should have read pages 127pp of Peter Kahrel's PDF on ScriptUI:
Changes in CC
– Typeface and type size can’t be changed.
disappointed to know that Typeface and type size can’t be changed in CC.
That will leave us with 'boring' user interface.. don't understand why Adobe wants to remove this 'good' feature. ;(