mclisa81 Posted May 27, 2016 Share Posted May 27, 2016 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 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">' + " " + '<z newsize="50">' + '<p override="true" br="false" superratio="44" superoffset="95"><superscript>' + "¢" + '</superscript>'; } } return newYourPrice; } The off rule newOffPrice = Field("Value2"); off = newOffPrice.replace(/ /g, '<span><z newsize=25>' + " " + '</span>'); OffPrice1 = '<span><z newsize=30> </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 Lisa95601_Coupons_template.pdftest2.txt Quote Link to comment Share on other sites More sharing options...
Developer Posted June 1, 2016 Share Posted June 1, 2016 Can you upload the font as well? Quote Link to comment Share on other sites More sharing options...
Developer Posted June 1, 2016 Share Posted June 1, 2016 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: return '<graphic file="C:\\Off.pdf">';Off.pdf Quote Link to comment Share on other sites More sharing options...
Developer Posted June 1, 2016 Share Posted June 1, 2016 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. Quote Link to comment Share on other sites More sharing options...
mclisa81 Posted June 2, 2016 Author Share Posted June 2, 2016 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 Quote Link to comment Share on other sites More sharing options...
esmith Posted June 7, 2016 Share Posted June 7, 2016 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. Quote Link to comment Share on other sites More sharing options...
mclisa81 Posted June 7, 2016 Author Share Posted June 7, 2016 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.