Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old January 19th, 2015, 12:32 PM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 211
Default Re: How to use Oldstyle figures in FP

Quote:
Originally Posted by wrenchmaster View Post
I appreciate the help... where do I insert this rule when completed?
Is the in the place of the field variable?
Yes, in the Variable Text Editor. Treat it like any other rule.
Reply With Quote
  #12  
Old January 19th, 2015, 12:40 PM
wrenchmaster wrenchmaster is offline
Junior Community Member
 
Join Date: Dec 2013
Posts: 44
Default Re: How to use Oldstyle figures in FP

OK, now before I try it let me make sure I have all my ducks lined up...

Just to make sure you a clear on what I am trying to accomplish, I have rambled on in the post and it may be confusing.

I have a data field called [Delivery Address] which contains the street number and name.

The customer is using minion pro and the fonts are old style Tabular Oldstyle.

How will I set the font? Do I set it in the text editor at the variable name?
Reply With Quote
  #13  
Old January 19th, 2015, 12:51 PM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 211
Default Re: How to use Oldstyle figures in FP

Quote:
Originally Posted by wrenchmaster View Post
OK, now before I try it let me make sure I have all my ducks lined up...

Just to make sure you a clear on what I am trying to accomplish, I have rambled on in the post and it may be confusing.

I have a data field called [Delivery Address] which contains the street number and name.

The customer is using minion pro and the fonts are old style Tabular Oldstyle.

How will I set the font? Do I set it in the text editor at the variable name?
Create a new rule called "rule_DeliveryAddress". Paste the code in as indicated but change the Field to Field("Delivery Address"). Check the box that says "Treat returned strings as tagged text".

Open text frame where you want the changed text and insert the «rule_DeliveryAddress» variable. Highlight it and change the font to Minion Pro.

Go to the compose dialog and the Advanced tab. Turn off the box that says "Limit processing to Latin-1 text". Let me know how it works.
Reply With Quote
  #14  
Old January 19th, 2015, 01:37 PM
wrenchmaster wrenchmaster is offline
Junior Community Member
 
Join Date: Dec 2013
Posts: 44
Default Re: How to use Oldstyle figures in FP

Doesn't seem to work, this is what I get.

Can you see the screen shot

Quote:
Originally Posted by ThomasLewis View Post
Create a new rule called "rule_DeliveryAddress". Paste the code in as indicated but change the Field to Field("Delivery Address"). Check the box that says "Treat returned strings as tagged text".

Open text frame where you want the changed text and insert the «rule_DeliveryAddress» variable. Highlight it and change the font to Minion Pro.

Go to the compose dialog and the Advanced tab. Turn off the box that says "Limit processing to Latin-1 text". Let me know how it works.
Attached Images
File Type: jpg Capture.jpg (85.7 KB, 6 views)
Reply With Quote
  #15  
Old January 19th, 2015, 01:52 PM
wrenchmaster wrenchmaster is offline
Junior Community Member
 
Join Date: Dec 2013
Posts: 44
Default Re: How to use Oldstyle figures in FP

In this capture the first line is how I want the delivery address to appear.
It is combine in a single field for both the street number and name.

The second line is how I want a variable called ask amount to appear. This is just a number in the fields.
Attached Images
File Type: jpg Example.jpg (19.6 KB, 4 views)
Reply With Quote
  #16  
Old January 19th, 2015, 02:03 PM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 211
Default Re: How to use Oldstyle figures in FP

Go back and look at my post with the script in it. It needs to be exactly as indicated. Notice how your post where you quoted me has the code messed up. If you copied and pasted from that, then it won't work.
Attached Images
File Type: jpg oldstyle-numerals.jpg (58.9 KB, 5 views)

Last edited by ThomasLewis; January 19th, 2015 at 02:10 PM.. Reason: Added screenshot. Where n represents a Field value.
Reply With Quote
  #17  
Old January 19th, 2015, 02:14 PM
wrenchmaster wrenchmaster is offline
Junior Community Member
 
Join Date: Dec 2013
Posts: 44
Default Re: How to use Oldstyle figures in FP

That worked!!!!!

I didn't notice the corruption.

Can I apply this to another rule for the ask amount variables?


Quote:
Originally Posted by ThomasLewis View Post
Go back and look at my post with the script in it. It needs to be exactly as indicated. Notice how your post where you quoted me has the code messed up. If you copied and pasted from that, then it won't work.
Reply With Quote
  #18  
Old January 19th, 2015, 02:25 PM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 211
Default Re: How to use Oldstyle figures in FP

Quote:
Originally Posted by wrenchmaster View Post
Can I apply this to another rule for the ask amount variables?
Sure. The only thing I would caution you on is this is specific to Minion Pro. It will probably work for other Adobe Pro fonts assuming they put the numerals in the same spot.

For future readers of this thread:
As Dan mentioned in the thread he pointed to earlier, there is no standard so it is impossible to predict where the numerical characters are. If you were to use this for other fonts you would need to find the unicode area where they are located using a program like Character Map and then get the ascii values. In this particular case it's a fortunate coincidence (or well planned) that the last character of the ascii value is the same as the numerical value, resulting in very a straight forward regex replacement.
Reply With Quote
  #19  
Old January 19th, 2015, 02:27 PM
wrenchmaster wrenchmaster is offline
Junior Community Member
 
Join Date: Dec 2013
Posts: 44
Default Re: How to use Oldstyle figures in FP

Thomas,

That worked great!

Now, when you have time can you explain what parts of the rule made it happen and how?

Thanks Again
Reply With Quote
  #20  
Old January 19th, 2015, 05:09 PM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 211
Default Re: How to use Oldstyle figures in FP

Quote:
Originally Posted by wrenchmaster View Post
Now, when you have time can you explain what parts of the rule made it happen and how?
There's a lot of good information in the links in Dan's signature. You might take a look at some of those and also learn about regular expressions. They can get quite complex depending on what you want to do.

Basically in this case we are just finding any digit 0-9 and replacing it with the ascii code for the oldstyle number.

Example for this specific case with Minion Pro:
(These should have an & in front of the # but the forums seem to hate this)
0 = #63280;
1 = #63281;
2 = #63282;
etc.

The $1 is a placeholder for what the replacement found, ie if it found a 3 then $1 is a 3.
As I mentioned earlier, this may not always be the case depending on where the font creator decides to put those figures.

Last edited by ThomasLewis; January 19th, 2015 at 05:14 PM..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:33 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.