Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > FusionPro® VDP Creator

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old January 13th, 2011, 08:12 AM
mstanton mstanton is offline
Regular Contributor
 
Join Date: Aug 2009
Posts: 65
Default Re: Help! Copyfit won't copyfit

Ok, that worked to hide the code. Thanks!
But still nothing shrinks to fit.
__________________
-Megan

I am Using: EFI Digital Storefront v7.0.0.20391 / FusionPro Designer 9.2.25 / Mac OS 10.6.8 / Acrobat 10.1.9 and Acrobat 11.0.06 / InDesign CC v9.2 and InDesign CS5.5 v7.5.3
Reply With Quote
  #12  
Old January 13th, 2011, 09:13 AM
mstanton mstanton is offline
Regular Contributor
 
Join Date: Aug 2009
Posts: 65
Default Re: Help! Copyfit won't copyfit

Ah-ha! I discovered the fatal flaw. I unchecked "Treat returned strings..." in the rule Clinic-Address and everything works fine now.
__________________
-Megan

I am Using: EFI Digital Storefront v7.0.0.20391 / FusionPro Designer 9.2.25 / Mac OS 10.6.8 / Acrobat 10.1.9 and Acrobat 11.0.06 / InDesign CC v9.2 and InDesign CS5.5 v7.5.3
Reply With Quote
  #13  
Old January 13th, 2011, 09:58 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: Help! Copyfit won't copyfit

Quote:
Originally Posted by mstanton View Post
Ok, that worked to hide the code. Thanks!
But still nothing shrinks to fit.
There's another problem in that ADDRESS rule, on the very last line where you're doing a String.replace. It's erroneously adding tags to the existing tags returned by the CopyfitLine function, which is messing things up. (You can see that it's putting something like "77" in front of the street number in the address.)

Try changing that last line to simply:
Code:
return text;
And you'll see the copyfitting working.

Now, how do we fix this to work with that other replace code? It looks like you're trying to change the font and point size of the numbers in the address, but this isn't the right way to do it. You need to take that different sizing of the numbers into account during the copyfitting, which needs to be the very last thing that happens before the text is put down. So we can change the order that things are happening in in the ADDRESS rule like so:
Code:
var numberFont = "Folio Light";
var numberWidth = "11";
var numberHeight = "10.5";
var text = Field("ADDRESS");
text = text.replace(/(\d+\s*)/g, function(d){return '<span font="' + numberFont + '"><z newsize="' + numberHeight + '"><setwidth newsize="' + numberWidth + '">' + d + '</span>';});
text = CopyfitLine("", text, "Alright Sans Regular", 7, 330, 6, false);
return text;
Now you should see numbers in that 10.5 point size and the rest of the address shrinking so that everything fits in the allotted space (330 points).

I think this still isn't quite right, because you probably don't always want to set the number in 10.5 point text if the size of the rest of the text varies because of copyfitting; instead, you probably want the size of the numbers to always be relative to the other text, which suggests using a <magnify> tag. But I'll leave that as another exercise.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #14  
Old January 13th, 2011, 10:02 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: Help! Copyfit won't copyfit

Quote:
Originally Posted by mstanton View Post
Ah-ha! I discovered the fatal flaw. I unchecked "Treat returned strings..." in the rule Clinic-Address and everything works fine now.
Actually, I don't see how that would make any difference, because that rule is returning a resource, so FusionPro ignores the check box because it knows that the resource itself contains tagged markup. I think the problem is what I said in my previous post, which is that you need to do the copyfitting last after any other tagging is applied. But if it's working, that's good.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #15  
Old January 14th, 2011, 08:26 AM
mstanton mstanton is offline
Regular Contributor
 
Join Date: Aug 2009
Posts: 65
Exclamation Re: Help! Copyfit won't copyfit

Quote:
Originally Posted by Dan Korn View Post
Code:
var numberFont = "Folio Light";
var numberWidth = "11";
var numberHeight = "10.5";
var text = Field("ADDRESS");
text = text.replace(/(\d+\s*)/g, function(d){return '<span font="' + numberFont + '"><z newsize="' + numberHeight + '"><setwidth newsize="' + numberWidth + '">' + d + '</span>';});
text = CopyfitLine("", text, "Alright Sans Regular", 7, 330, 6, false);
return text;
Now you should see numbers in that 10.5 point size and the rest of the address shrinking so that everything fits in the allotted space (330 points).
Ok, well that gets rid of the mysterious sevens, but now everything but the numbers has shrunk to teeny tiny text even when it doesn't come close to filling the 330 point space.

I don't want the text to be small all of the time and I most certainly do not want the numbers to stay large when the rest of the text is supposed to be smaller. How do I accomplish this?
__________________
-Megan

I am Using: EFI Digital Storefront v7.0.0.20391 / FusionPro Designer 9.2.25 / Mac OS 10.6.8 / Acrobat 10.1.9 and Acrobat 11.0.06 / InDesign CC v9.2 and InDesign CS5.5 v7.5.3
Reply With Quote
  #16  
Old January 14th, 2011, 02:14 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,305
Default Re: Help! Copyfit won't copyfit

Quote:
Originally Posted by mstanton View Post
Ok, well that gets rid of the mysterious sevens, but now everything but the numbers has shrunk to teeny tiny text even when it doesn't come close to filling the 330 point space.
Well, I think the main problem is that you're starting out at 7 points as the maximum size for the text. You probably want to start bigger and let it shrink as needed. So that first number in the call to CopyfitLine should probably be something like 10, to match the size of the other text. Of course, you can start with a smaller number, but it's more likely that space will be left over.

Also, the space you're trying to fill is a lot less than 330 points; I think it's more like 260 points, so that's what I would put for the second number. Try this:
Code:
text = CopyfitLine("", text, "Alright Sans Regular", 10, 260, 5, false);
When I do this (although I'm using Arial since I don't have your font), the text does size itself to fill up the entire space. But now the numbers are smaller than the other text, because that point size is hard-coded to 10.5 points. Which leads into your next question...
Quote:
Originally Posted by mstanton View Post
I don't want the text to be small all of the time and I most certainly do not want the numbers to stay large when the rest of the text is supposed to be smaller. How do I accomplish this?
Like I said, you probably don't want to have the size of the numbers fixed while everything else shrinks to fit. I would use a <magnify> tag to keep it always proportional to the rest of the text. Something like this:
Code:
text = text.replace(/(\d+\s*)/g, function(d){return '<span font="' + numberFont + '"><magnify type=pointsize factor=120>' + d + '</magnify></span>';});
Putting it all together:
Code:
var numberFont = "Folio Light";
var startingPointSize = 10;
var minPointSize = 5;
var maxWidthPoints = 260;
var numberMagnifyFactor = 120;
var text = Field("ADDRESS");
text = text.replace(/(\d+\s*)/g, function(d){return '<span font="' + numberFont + '"><magnify type=pointsize factor=' + numberMagnifyFactor + '>' + d + '</magnify></span>';});
text = CopyfitLine("", text, "Alright Sans Regular", startingPointSize, maxWidthPoints, minPointSize, false);
return text;
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
Reply

Tags
copyfit, copyfitline

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 02:04 PM.


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