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

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 27th, 2016, 09:40 AM
mclisa81 mclisa81 is offline
Regular Contributor
 
Join Date: Oct 2008
Location: Manchester CT
Posts: 97
Default Superscript and tracking issues

Hi,

This is a 2 part problem. I'm trying to match (or come close) to the 2 static examples at the top of the template page.

1) I need the space between the $ and the 1 closed up. I'd actually like it a more closed up between all the numbers if possible since the client may ask for that after they see the proof.
2) I need tighter tracking on the word "OFF".

In both cases if I remove the superscript tag from my function/rule, it sees the tracking tag.


My javascript global
Code:
function YourPrice(price)

{
    var newYourPrice = "";
	var trimPrice = price.replace(/[^\d\.]/g,''); // Strips out anything that's not a digit or a decimal
	var decimalPrice = FormatNumber("0.00", trimPrice); // Formats to 2 decimals
    var SuperPrice = decimalPrice.split(".")[1]; // Everything to the right of the decimal
    var SuperPriceNoZero = SuperPrice.replace(/00/g, "");
    var NormalPrice = decimalPrice.split(".")[0]; // Everything to the left of the decimal
    var regOneMatch = /1/g;
    var NormalPrice1 = NormalPrice.replace(regOneMatch, "<tracking newsize=\"-12\">1</tracking>");
    var dollar = "<tracking newsize=\"-40\">$</tracking>";
	
            
    if (price != "")
	{	
        // If the price doesn't start with zeros, format as $x.xx
        if (NormalPrice1.replace(/0/g,'')){
            newYourPrice = '<p override="true" br="false" superratio="44" superoffset="95"><superscript>' + dollar + '</superscript>' + NormalPrice1 + '<p override="true" br="false" superratio="44" superoffset="95"><superscript>' + SuperPriceNoZero + '</superscript>';
        }
        // If the price is cents only, format as: xx˘
        else {
            newYourPrice = '<tracking newsize="-5">' + SuperPriceNoZero + '</tracking>' + '<z newsize="8">' + "&thinsp;" + '<z newsize="50">' + '<p override="true" br="false" superratio="44" superoffset="95"><superscript>' + "&cent;" + '</superscript>';
        }
	}

return newYourPrice;
}
The off rule
Code:
    newOffPrice = Field("Value2");
    off = newOffPrice.replace(/ /g, '<span><z newsize=25>' + "&nbsp;" + '</span>');

    
    OffPrice1 =  '<span><z newsize=30>&nbsp;</span>' + '<span><p override="true" br="false" superratio="60" superoffset="50"><tracking newsize="-12"><uppercase>' + off +'</span></tracking>';

    return OffPrice1;
I'll upload the template if that will help.

Any help is appreciated since I'm on a tight deadline for this.

Thanks
Lisa
Attached Files
File Type: pdf 95601_Coupons_template.pdf (85.3 KB, 17 views)
File Type: txt test2.txt (9.2 KB, 13 views)
Reply With Quote
  #2  
Old June 1st, 2016, 12:28 PM
Developer Developer is offline
Junior Community Member
 
Join Date: Sep 2013
Location: Connecticut, USA
Posts: 28
Default Re: Superscript and tracking issues

Can you upload the font as well?
__________________
VDP Creator (Desktop)
FusionPro VDP software version 11.1.2
Windows 10 64-bit
Adobe Acrobat Pro DC Version 2020.013.20074
Reply With Quote
  #3  
Old June 1st, 2016, 01:07 PM
Developer Developer is offline
Junior Community Member
 
Join Date: Sep 2013
Location: Connecticut, USA
Posts: 28
Default Re: Superscript and tracking issues

You could try cropping the area around the word "off" in your static sample. See attached. Then insert the word "off" in your variable text editor as a graphic, using a text rule with a graphic tag linked to an "off.pdf" file or resource. Something like this:

Code:
return '<graphic file="C:\\Off.pdf">';
Attached Files
File Type: pdf Off.pdf (66.8 KB, 15 views)
__________________
VDP Creator (Desktop)
FusionPro VDP software version 11.1.2
Windows 10 64-bit
Adobe Acrobat Pro DC Version 2020.013.20074
Reply With Quote
  #4  
Old June 1st, 2016, 01:12 PM
Developer Developer is offline
Junior Community Member
 
Join Date: Sep 2013
Location: Connecticut, USA
Posts: 28
Default Re: Superscript and tracking issues

Another idea, to tighten up the space between the $ and the 1, you could put the $ in a separate text frame. Position the new text frame with the $ right next to the 1, as close as you want it. For records where there should be a cents sign instead of a dollar sign, turn off the $ in that frame, have a rule that returns "" (empty quotes) instead of a dollar sign.
__________________
VDP Creator (Desktop)
FusionPro VDP software version 11.1.2
Windows 10 64-bit
Adobe Acrobat Pro DC Version 2020.013.20074
Reply With Quote
  #5  
Old June 2nd, 2016, 04:31 AM
mclisa81 mclisa81 is offline
Regular Contributor
 
Join Date: Oct 2008
Location: Manchester CT
Posts: 97
Default Re: Superscript and tracking issues

Hi,

Thanks for your reply. I've read other posts on the forum with the same issue, so I figured it was something I'd have to find a workaround for. However, I was kind of hoping they would have come up with a fix for this. Thanks again for the suggestion!



Lisa
Reply With Quote
  #6  
Old June 7th, 2016, 09:27 AM
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 869
Default Re: Superscript and tracking issues

One solution we applied for something like this was to create a custom version of the font in Fontographer specifically for a project. In the custom font, we made the dollar/cent signs superscripted by default (so no tag necessary) and tightened up the kerning built in to each of the numeral characters.

We also used one of the unused symbol characters to insert "graphics" as type (e.g. a "^" character would insert the word "OFF" custom designed to client specs). Then we would perform a replace() to swap the string "OFF" with "^" wherever it occurred.
Reply With Quote
  #7  
Old June 7th, 2016, 10:12 AM
mclisa81 mclisa81 is offline
Regular Contributor
 
Join Date: Oct 2008
Location: Manchester CT
Posts: 97
Default Re: Superscript and tracking issues

Hi Eric,

Thanks for the reply.

I actually downloaded FontForge, we no longer have Fontographer, last week and started to poke around in it. In my spare time (haha), I am going to try your suggestion. It seems like it will work out well for this project.

Thanks
Lisa
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 03:36 PM.


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