jhaughey Posted June 12, 2017 Share Posted June 12, 2017 Trying to return a single bold character in a string. Client wants a bold "F" after the fax number (if there is one.) I can't suppress the whole line when fax is empty, because there are other items on the line. Trying this: var fax = Rule("fax_Rule"); if (fax.length > 0) { return fax + " " + <b>F</b> ; } I have the "Treat returned strings as tagged text" checked, but the F is not coming back bold. Any thoughts? Thanks. Quote Link to comment Share on other sites More sharing options...
-Lisa- Posted June 13, 2017 Share Posted June 13, 2017 If the font family you're using has an actual bold style, you'll need to actually use the font name tag rather than use the bold tags so the font switches to the bolded version. For instance, say the font is Arial Bold, you would use: var fax = Rule("fax_Rule"); if (fax.length > 0) { return fax + " " + <f name="Arial Bold">F</f> ; } Quote Link to comment Share on other sites More sharing options...
jhaughey Posted June 13, 2017 Author Share Posted June 13, 2017 Lisa, Thanks for your reply. I tried that also but without luck. The 'F' is still not bold. Here is the full code: var fax = Rule("fax_Rule"); if (fax.length > 0) { return fax + " " + <f name="TheSans B7 Bold">F</f> ; } else return ""; Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 13, 2017 Share Posted June 13, 2017 If you compose (not Preview) and view the log (.msg) file, are there any messages in there about the font, or about not having a bold style? Or any other errors? Also, this may be a silly question, but are you sure that you're actually calling out that rule in the Text Editor? Quote Link to comment Share on other sites More sharing options...
jhaughey Posted June 13, 2017 Author Share Posted June 13, 2017 I have no errors in the log. The rule definitely being called. It's producing the correct result, except for the 'F' not being bold. Quote Link to comment Share on other sites More sharing options...
jhaughey Posted June 13, 2017 Author Share Posted June 13, 2017 also, if I change the font name to some garbage text "dskldskflj" I still get no error. It just seems to be ignoring the tags entirely. Quote Link to comment Share on other sites More sharing options...
step Posted June 13, 2017 Share Posted June 13, 2017 Trying to return a single bold character in a string. Client wants a bold "F" after the fax number (if there is one.) I can't suppress the whole line when fax is empty, because there are other items on the line. Trying this: I have the "Treat returned strings as tagged text" checked, but the F is not coming back bold. Any thoughts? Thanks. You need to put quotes around your tags: var fax = Rule("fax_Rule"); if (fax.length > 0) { return fax + " " + [color="Red"]"[/color]<b>F</b>[color="red"]"[/color] ; } Or: var fax = Rule("fax_Rule"); if (fax) return fax + " <b>F</b>"; Quote Link to comment Share on other sites More sharing options...
jhaughey Posted June 13, 2017 Author Share Posted June 13, 2017 Thanks Step! Always something dumb like that. Did not work with the 'b' tags, but it works with the font call. var fax = Rule("fax_Rule"); if (fax.length > 0) { return fax + " " + "<f name=\"TheSans B7 Bold\">F</f>" ; } else return ""; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.