Copy link to clipboard
Copied
Hi there,
Need advice here, am trying to set Brush Script Std font to a statictext called 'label', but encounter error.
Please help..
label.graphics.font = ScriptUI.newFont ("Brush Script Std", "", 14);
Copy link to clipboard
Copied
What error do you get?
Copy link to clipboard
Copied
error code 511
Invalid font style
Copy link to clipboard
Copied
No wonder.
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)
Regards,
Uwe
Copy link to clipboard
Copied
nope.. it doesn't work.
Error code: 511 Invalid font style 'Medium'
Copy link to clipboard
Copied
Ok.
Then I tested with the predefined string "REGULAR":
ScriptUI.newFont("Brush Script Std", "REGULAR", 14);
That worked.
InDesign CS6 on OSX 10.10.5.
Regards,
Uwe
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
Hi eboda_snaf,
tested this with a script snippet by Peter Kahrel's scriptui-2-13-f-2017.pdf page 40.
https://indd.adobe.com/view/a0207571-ff5b-4bbf-a540-07079bd21d75
Where I simply changed this line:
headers.children.graphics.font = ScriptUI.newFont ("Arial", 'BOLD', 12)
To that one:
headers.children.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.
Regards,
Uwe
Copy link to clipboard
Copied
Here some more information, but maybe outdated a bit for CC 2017:
Indiscripts :: ScriptUI Fonts Facts
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?
Regards,
Uwe
Copy link to clipboard
Copied
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.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.graphics.font = "BrushScriptStd:14";
For Windows the results could be quite different.
Depending on used font and version of InDesign.
Regards,
Uwe
Copy link to clipboard
Copied
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.
…
Regards,
Uwe
Copy link to clipboard
Copied
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. ;(