-
1. Re: [JS][CSX] ScriptUI Tip
Harbs. May 31, 2010 3:41 AM (in response to Roy Marshall)Cute!
FWIW, the "official" way to use a bold font is like this:
var font = myMainPanel.graphics.font.family; var fontSize = myMainPanel.graphics.font.size; var boldFont = ScriptUI.newFont (font,'BOLD',fontSize); var myText = myMainPanel.add('statictext',[15,15,260,34.5],'Choose the mailer to run the script for'); myText.graphics.font = boldFont;Harbs
-
2. Re: [JS][CSX] ScriptUI Tip
Roy Marshall May 31, 2010 1:32 PM (in response to Harbs.)I should've guessed there was a correct way to do this! Consider my efforts a hack. Sort of using the "B" for Bold in the MS Word Toolbar, when as we DTP Pros all know you should be using the correct font weight!
I will probably play with these settings when I get a moment,
Cheers
Roy
-
-
4. Re: [JS][CSX] ScriptUI Tip
Harbs. May 31, 2010 10:28 PM (in response to Roy Marshall)Sorry!
Much nicer!
Harbs
-
5. Re: [JS][CSX] ScriptUI Tip
Steven.. May 31, 2010 10:39 PM (in response to Roy Marshall)Beware, Harbs bold trick, doesn't always work on windows. I think panels specificly show bold text correctly on mac but not on Windows
-
6. Re: [JS][CSX] ScriptUI Tip
Harbs. May 31, 2010 10:43 PM (in response to Steven..)Steven,
I didn't know it was a "trick"...
Can you give more details? Which version?
Harbs
-
7. Re: [JS][CSX] ScriptUI Tip
Steven.. May 31, 2010 10:57 PM (in response to Harbs.)Here is some Rapid ScriptUI code
var rapidDlg = new Window('dialog',"Bold",undefined); buildWindow(); rapidDlg.show(); function buildWindow(){ // Properties for rapidDlg.StaticText1 rapidDlg.StaticText1 = rapidDlg.add('statictext',undefined,"Lets Be Bold"); rapidDlg.StaticText1.graphics.font = ScriptUI.newFont(rapidDlg.StaticText1.graphics.font.family,"BOLD",rapidDlg.StaticText1.graphics.font.size); // Properties for rapidDlg.Panel1 rapidDlg.Panel1 = rapidDlg.add('panel',undefined,"I'm Bold on a mac"); rapidDlg.Panel1.graphics.font = ScriptUI.newFont(rapidDlg.Panel1.graphics.font.family,"BOLD",rapidDlg.Panel1.graphics.font.size); // Properties for rapidDlg.Panel1.Button1 rapidDlg.Panel1.Button1 = rapidDlg.Panel1.add('button',undefined,"Hey Bold fellow"); rapidDlg.Panel1.Button1.graphics.font = ScriptUI.newFont(rapidDlg.Panel1.Button1.graphics.font.family,"BOLD",rapidDlg.Panel1.Button1.graphics.font.size); }This is what it looks like on Windows XP SP3 using CS4 & CS5
if I remember correctly it does show correctly on the mac
-
8. Re: [JS][CSX] ScriptUI Tip
Marijan Tompa May 31, 2010 11:23 PM (in response to Steven..)Hey Steven!
Just tested your code here, Windows 7 64-bit, InDesign CS5, and it's same, panel text isn't bold.
tomaxxi
-
9. Re: [JS][CSX] ScriptUI Tip
Harbs. May 31, 2010 11:56 PM (in response to Steven..)Yes. It's bold on Mac.
So it's panel labels which have this problem.
I assume the same happens if you use a reference to the window.graphics gont. Yes?
Harbs
-
10. Re: [JS][CSX] ScriptUI Tip
Harbs. Jun 1, 2010 12:06 AM (in response to Steven..)Hmm.
Actually, it's not Bold on the Mac -- I'd say it's Black. It's a much heavier weight than bold in other elements...
Harbs
-
-
12. Re: [JS][CSX] ScriptUI Tip
Steven.. Jun 1, 2010 11:00 AM (in response to Harbs.)even this doesn't work
var rapidDlg = new Window('dialog',"Bold",undefined); buildWindow(); rapidDlg.show(); function buildWindow(){ // Properties for rapidDlg.StaticText1 rapidDlg.StaticText1 = rapidDlg.add('statictext',undefined,"Lets Be Bold"); rapidDlg.StaticText1.graphics.font = ScriptUI.newFont("Arial","BOLD",rapidDlg.StaticText1.graphics.font.size); // Properties for rapidDlg.Panel1 rapidDlg.Panel1 = rapidDlg.add('panel',undefined,"I'm Bold on a mac"); rapidDlg.Panel1.graphics.font = ScriptUI.newFont("Gill Sans Ultra Bold","Regular",rapidDlg.Panel1.graphics.font.size); // Properties for rapidDlg.Panel1.Button1 rapidDlg.Panel1.Button1 = rapidDlg.Panel1.add('button',undefined,"Hey Bold fellow"); rapidDlg.Panel1.Button1.graphics.font = ScriptUI.newFont("Gill Sans Ultra Bold","Regular",rapidDlg.Panel1.Button1.graphics.font.size); }looks like this
which means that the font object is not wired at all for panel on Windows
-
13. Re: [JS][CSX] ScriptUI Tip
Harbs. Jun 1, 2010 11:10 AM (in response to Steven..)I wouldn't say it's not wired.
If you pay attention, you'll notice that the border leaves room for the wider font. The text is just not drawn correctly...
Harbs
-
14. Re: [JS][CSX] ScriptUI Tip
Roy Marshall Jun 2, 2010 1:39 AM (in response to Harbs.)Wow, thanks for the cool input. Harbs, I Checked out Kris' post. Most interesting. What I have ended up doing is making an Applescript app in Xcode. Saved as a floating window, gave it a cool icon, and it looks, and works good. I still feel I have cheated taking this route, as it takes 5 mins to throw this together with only a single doscript line of code in Applescrip to trigger my long scripts. Still, it works. Thanks all again for your help Roy
-
15. Re: [JS][CSX] ScriptUI Tip
booyajamo Nov 5, 2013 4:57 PM (in response to Harbs.)Hi Harbs,
I've been struggling to get panel label to show up bold as well. You say the text is not drawn correctly. Are you able to show an example of how you could write it so the panel label is bold? I'm working in Windows 7 CS6.
I'm OK if it's simply black too. I am just hoping for a way to make the panel label a little larger and bolder than the contents.
Thanks,
Lindsay






