Jump to content

finding out how to superscript registration marks, trademarks and copyrights symbols


jwickman

Recommended Posts

I have searched your manuals, site, and forum. I cannot find out how to superscript a registration mark, trademark or copyright that comes in from the data. :confused:

 

I just did a ® from characters map into a data source and applied superscript to it. Worked for me.

 

In Variable text editor, do you see SUP button? It should be two buttons to the right from the U button.

Link to comment
Share on other sites

Well, that will superscript all the words and the registration mark. The mark is in the data, so I need a rule that tells it to superscript that symbol when it sees it.

 

 

jwickman, this will only work for one symbol. Give me sometime to work on it or maybe Dan or others could modify it to work for multiple symbols.

 

return Field("symbol").replace(/[.®234567890]/g,"$+<superscript>®</superscript>");; 

You can change the numbers to what you want superscripted only. Name of the field for me was called symbol.

 

As you can see, ® was used to test.

Edited by rpaterick
Link to comment
Share on other sites

It worked!!! Thanks so much!

 

 

It will work for just that symbol in your data file. If you have multiple symbols throughout the run, the code will have to adjusted to allow multiple symbols. I'm not sure on how to do multiple symbols at this point. Also, you may want to delete the "." and "numbers" to be safe.

Link to comment
Share on other sites

At this point I only have the registration mark in that field. And I have the "TM" in another field and it worked for that one too. I guess if I run into the situation where there is a registration mark and a "TM" in the same field, then I would need the rule to be able to recognize each and superscript them. If you know what that would be, please pass it my way. Thanks for your help.
Link to comment
Share on other sites

One is easy, the other, not so much.

 

For the trademark symbol, one option is to use the entities defined

in the FusionPro Tags Reference Guide, specifically the ™ entity.

If you're doing this in your flat (delimited) input file, you may need

to check the "Treat field values as tagged text" box on the Flat File

step of the Data Source Wizard.

 

You can also return the entity directly from a rule, like so:

 

return "™";

 

Make sure to check "Treat returned strings as tagged text." You could

name the rule "Trademark" and insert it in the Text Editor wherever

needed.

 

Another option is to use either the Character Map utility on Windows or

the Character Palette on Mac to locate the trademark symbol and insert

it directly into the Text Editor. (Unlike in external files, any text

entered into the Variable Text Editor dialog in FusionPro will

automatically be converted to the proper encoding when moving your job

across platforms.)

 

The Service Mark (SM) symbol is a little trickier; that's a non-ASCII

Unicode character. As such, it's not supported by FusionPro, and is not

found in all fonts either. However, you may be able to find a Symbol

font which contains it in the ASCII range (under 255), and use a numeric

entity such as ÿ (or whatever the ASCII value is). The ASCII value

may be specific to the font and the platform encoding.

 

Your best bet for the Service Mark symbol is probably to fake it using

the letters "SM" in superscript. This should work in any font and

platform.

Link to comment
Share on other sites

Something like this might be what you're looking for:

return Field("YourFieldName").replace(/((?:TM)|[©®])/g,"<superscript>$&</superscript>");

Sorry, I don't have the time or space here to fully break down this code and explain it. Regular expressions are an advanced topic, so I recommend you don't go modifying examples of other code unless you really understand what you're doing. But they can be a very powerful tool.

 

Another caveat: be careful of your encodings. These kinds of symbols are generally encoded differently on Windows and Mac, so if you're moving your job between platforms, especially if the symbols are in your input file, you may have issues. You can generally alleviate these by explicitly setting the input file's encoding in the Data Source Wizard.

Link to comment
Share on other sites

We have the following function added to the \Printable\FusionPro\Plug-Ins directory in a company global JavaScript file:

function superScript ( str )
{
str = str.replace(/(\$)/g,"<superscript>$</superscript>");
str = str.replace(/(®)/g,"<superscript>®</superscript>");
str = str.replace(/(\(r\))/ig,"<superscript>®</superscript>");
str = str.replace(/(©)/g,"<superscript>©</superscript>");
str = str.replace(/(\(c\))/ig,"<superscript>©</superscript>");
str = str.replace(/(™)/g,"<superscript>™</superscript>");
str = str.replace(/(\(tm\))/ig,"<superscript>™</superscript>");
return str;
}

Then, whenever we are using data that includes a trademark, register mark, copyright, or dollar sign, we can just return the field via a custom routine:

return superScript(Field("yourField"));

Link to comment
Share on other sites

  • 2 years later...

Sorry to bring up a very old thread but this may apply for me. I used the code esmith posted in my globals, I then went one further to create a rule template. My only problem is I lose the space in the input data field after the ® or © if the data has an amperstand after. So if my input data had say "Visa® & Amex" it would return it Visa®& Amex with the ® superscripted but I lose the space between the ® andf the &. If the data doesn't have those two elements consecutively the space is still there for example "Visa® Amex will work fine returning the ® superscipted. Thanks for any ideas. I did add these to the code:

str = str.replace(/(®)/g,"<superscript>®</superscript>");
str = str.replace(/(©)/g,"<superscript>©</superscript>");

Edited by dreimer
Link to comment
Share on other sites

I have attached a sample of it. I have a work around where I had to manipulate my template but I do this job somewhat often and was hoping to make it more of a template that I can use over and over without having to change pages on the template. I use CSV for most everything, not sure if that is an issue. I made it a txt file so I could upload.

72694_Sample.txt

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