Jump to content

® changing font / superscript

Recommended Posts

I have a rule that changes the font of the ® character from Minion Pro to Arial, because the superscript ® isn't a character in Minion Pro:


lcFieldContent = Field("AgentContactName")

return ReplaceSubstring(lcFieldContent,"®","<f name=\"Arial\"><superscript>®</superscript></f>")


A simple rule that works great, for the client weekly feed. However, there is another process that allows the client 1-offs, they go to their website and populate the data in form fields, and that process isn't going so well.


It is populating the ® as Â, AND correctly populating the ® symbol as superscripted. So the output is as such:


Generic Testname, CIPP®

The  is Minion Pro, the original font, and the ® is the correct Arial Font, superscripted as it should be.


I've tried a few different rules for replacing substrings and whatnot, but I'm at an impasse. Any thoughts?

Link to comment
Share on other sites

Well, it's hard to say exactly what's going wrong without seeing the data file that the web application is generating from the form fields are generating and presenting to FusionPro. It's probably using a different encoding for the registered character, or possibly a different character altogether.


Using Unicode data all the way through might solve the problem, as I note here:



Or, if you can't switch to Unicode, this might work:

return ReplaceSubstring(TaggedTextFromRaw(lcFieldContent), "®",
   "<f name=\"Arial\"><superscript>®</superscript></f>");

Link to comment
Share on other sites

  • 1 month later...

So this code wound up working courtesy of the guy who knows way more than me:


lcFieldContent = Field("Left_Content")

var rval = ReplaceSubstring(lcFieldContent,"®","<f name=\"Arial\"><superscript>®</superscript></f>");

rval = rval.replace( new RegExp("\u00C2","gm"),"");

return rval;


The newest trick is now on a different job, it's giving me multiple bad characters when trying to populate a simple apostrophe. I've been trying to modify that code above to accommodate a few (specifically the euro symbol, the "TM" symbol and a lower case version of the "A" character above, as well as the capitalized version.


Now, the above code replaces the ® with one in Arial, so it'll populate. I don't need that, I just need to eliminate these guys - € (\u20AC) â (\u00E2) ™(\u2122)...



Remember when Prepress was cutting orange paper with an exacto knife?

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