Jump to content

Bold character in string


Recommended Posts

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.

Link to comment
Share on other sites

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> ; }

Link to comment
Share on other sites

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 "";

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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>";

Link to comment
Share on other sites

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 "";

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...