Jump to content

Hard space to color


Recommended Posts

I understand that this Rule will turn regular spaces to "Hard spaces and will not break.


return ReplaceSubstring(Field("Variable_FIELD1")," "," ")


Now is there a way to turn that hard space to print in color.


Reason is some of our client have custom fonts and their mapping of characters are messy, sometimes I get "question marks in boxes" being printed. Now if I can tell that "Hard space" to print in "White" then I can keep using the client custom fonts.


So I just want to add on to this rule and after it converts to Hard Spaces I then want to change the color. Hope this is clear.

Link to comment
Share on other sites

You can use color tags in your replace string. So instead of just returning the non breaking space, you can return the color tag, then the non breaking space and then return the color to the original color. Make sure you have color swatches in FP named White and replace OriginalColor with the name of your color. Make sure you have "Treat returned strings as tagged text" checked.

return ReplaceSubstring(Field("Variable_FIELD1")," ",'<color name="White"> <color name="OriginalColor">');

Not sure if there is a better solution for this, but this should change your text to white.

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.

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