Jump to content

Change font on non-breakable space


sschardan

Recommended Posts

I am using the following code to prevent orphans in my project:

 

return TaggedTextFromRaw("• Get the best value for your " + RTrim(Field("CustomerBoatInfo")) + " and the best price on a new boat").replace(/(.*)(\s)(.+)$/, "$1 $3");

 

My problem is that the font being used for this line of text renders the non-breakable space as a missing glyph box. If I change the font of the whole line, it renders fine, except for the fact that it is the wrong font.

 

I need to change the font of the non-breakable space only. I have tried inserting the font tag in various places with no luck. Each time I wind up getting an "unknown entity   error. How can I do this?

 

FP Creator 8.0.20

Mac OS 10.6

Acrobat 9

Link to comment
Share on other sites

I am using the following code to prevent orphans in my project:

 

return TaggedTextFromRaw("• Get the best value for your " + RTrim(Field("CustomerBoatInfo")) + " and the best price on a new boat").replace(/(.*)(\s)(.+)$/, "$1 $3");

My problem is that the font being used for this line of text renders the non-breakable space as a missing glyph box. If I change the font of the whole line, it renders fine, except for the fact that it is the wrong font.

 

I need to change the font of the non-breakable space only. I have tried inserting the font tag in various places with no luck. Each time I wind up getting an "unknown entity   error. How can I do this?

 

FP Creator 8.0.20

Mac OS 10.6

Acrobat 9

Just add the <f name="***"> and </f> tags before and after the   entity, like so:

return TaggedTextFromRaw("• Get the best value for your " +  RTrim(Field("CustomerBoatInfo")) + " and the best price on a new  boat").replace(/(.*)(\s)(.+)$/, '$1<f name="Arial"> </f>$3');

Although, in this example, I'm not sure why you need to do the replacement at all, since you already know where the non-breaking space needs to go, between "new" and "boat." So you could just do this instead:

return '•&[size=2]#[/size]32;Get the best value for your ' +  RTrim(Field("CustomerBoatInfo")) + ' and the best price on a new<f  name="Arial"> </f>boat'

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...