Jump to content

jl_arnold

Registered Users - Approved
  • Posts

    53
  • Joined

Converted

  • FusionPro Products
    No

jl_arnold's Achievements

Contributor

Contributor (5/14)

  • First Post Rare
  • Collaborator Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

10

Reputation

  1. You are correct, that was a typo.. Here is the true flow: 1) Text Frame 1 fills and flows to frame 2. 2) Text Frame 1 does not fill. Text Frame 2 fills. Point size and leading reduced. Text Frame 2 should never flow to text frame 1. I understand how it seems off topic, but I did have another thread about the text flow using the p tag for verticalstart="topofpage". And while your code did what I needed for the Min font size, I was also trying to set the minimum lead size which could not be done without a regex for replace. I know where I need to modify my coding to get this to function how I need to, but I just don't know how to, or if it's possible. Basically I have two separate replace functions going on in my Copyfit rule. I need them to work simultaneously, but they seem to work one, then the other. var minSize = 9; var leadingSizeBody = 14 if (FusionPro.Composition.CurrentFlow.name == "MainArticleBodyCopy1-3") { var cf = FusionPro.Composition.CurrentFlow; // If it doesn't fit, don't start back page at "topofpage" if (!cf.fits) cf.content = cf.content.replace(/<variable name="([^"]+)">/g, function(s,p) { return RuleOrField(p).replace('verticalstart="topofpage"', 'leadbefore="0"'); }); if (!Copyfit(new MagnifyAttributes("text", 80, 150, minSize, 10),new MagnifyAttributes("leading", 80, 150, leadingSizeBody, 15))) cf.content = '<para><span pointsize="' + minSize +'">' + cf.content.replace(/(quad="[A-Z]" )(leading="\d+")?/g, function(s,p) { return p + 'leading="' + leadingSizeBody * 10 + '"'; }) + '</span></para>'; ReportWarning("Could not copyfit text in flow " + FusionPro.Composition.CurrentFlow.name); } I don't know if if it's possible to combine the replace functions, but I thought I would ask you here anyway. THanks, Jason
  2. I'm really struggling with this now. To simply everything, I have used your sample file. The issue I am encountering is due to text frame flowing. The script you have provided takes into account the point size and leading, but this needs to be determined for two frames, where content can flow from frame 1 to frame 2, but even if content on frame 2 fills and there is room on frame 1, text can never flow from frame 1 to frame 2. I am attaching your modified sample with the script I had created in my template. I have not been successful modifying the code to all scenarios needed. 1) I am using resources to display the text. 2) The resources are returned as content in rules (set as front / back) to set which resource is front and which is back. 3) The rules are then returned as RawTextFromTagged in a rule called TextFlow, which joins the front and back copy with <p verticalstart="topofpage"> 4) Linked frames (blue and magenta) display Rule(TextFlow) How this should work: 1) if Frame 1 does not fill, start Resource 2 [Rule(Set back copy to back)] text on back 2) if Frame 1 fills, start a new paragraph with Resource 2. 3) If Frame 1 does not fill but Frame 2 does, copyfit text and leading, while keeping <p verticalstart="topofpage">. 4) If Frame 1 fills and frame 2 fills reduce font size and leading. Honestly, I don't care if copyfit is set before replacing the vertical start for page 2. I'm just having all sorts of problems. Mainly when frame 2 fills, content flows to frame 1. Also I am not getting my font size to reduce to 9 points. Can you take a look at this for me? sample_copy-edit.zip
  3. SteP! Just wanted to thank you for providing that sample!!!! It worked great when entered with my existing codes after removing the first tags that were setting the sizing before copyfit. I haven't fully tested every field in MarcomCentral yet but it seems to be working just as needed for all fields. I just had to play around with the Resources I had created, setting the Main Article Copy for the Front Only to override existing paragraph formatting. I'm not sure what that setting has done in the past, but it seems to work INCREDIBLY now!! I have to take you for all your help and Javascript knowledge. Thanks again! Jason
  4. I think the issue may lay with MarcomCentral. In the two back textboxes the left one has 500+ characters entered in the field while the textbox on the right has exactly 237. I'm wanting 238+ characters to act the same as 237, but it doesn't. I'll go through your code and example and let you know how it goes! It looks like it should help! Thanks! Jason
  5. Hey Step, This seemed to be working just fine, but I think I've actually found a small issue that I think you'll be able to help. The issue I am having is that I am trying to set a minimum font and minimum leading. I have modifed the code you provided, with the code from your Copyfit Text and Leading post (http://forums.printable.com/showthread.php?t=4071&highlight=font+size+leading). I think I'm having a similiar issue you had. What I'm trying to accomplish is if the text does not fit the frame, then the font is reduced. Once the pointsize or leading is reduced and cannot copyfit anymore, I want to use my minimum values for pointsize and leading, which are not proportional, but set values. I've attempted the following two codes. if (FusionPro.Composition.CurrentFlow.name == "MyTextFrame") { var cf = FusionPro.Composition.CurrentFlow; if (!cf.fits) cf.content = '<span pointsize="' + minSizeCaption +'"><leading newsize="' + leadingSizeCaption + '">' + cf.content + '</leading></span>'; if (!Copyfit(new MagnifyAttributes("text", 25, 400, 7, 8.5),new MagnifyAttributes("leading", 25, 400, 10, 12))) cf.content = '<span pointsize="' + minSizeCaption +'"><leading newsize="' + maxleadingSizeCaption + '">' + cf.content + '</leading></span>'; ReportWarning("Could not copyfit text in flow " + FusionPro.Composition.CurrentFlow.name); } This works for both to an extent, but if I enter 200 characters and only 100 are visible with copyfit, than the text will reduce to the minimum size but the leading ends up being 12 point. So I made a change to this code: if (FusionPro.Composition.CurrentFlow.name == "MyTextFrame") { // default settings var pointsize_min = 7; var pointsize_max = 8.5; var leadsize_min = 10; var leadsize_max = 12; var mag_min = 25; var mag_max = 400; var leadmag_min = 25; var leadmag_max = 400; var cf = FusionPro.Composition.CurrentFlow.content; cf = cf.replace(/<variable name="([^"]*)">/g,function(a,b){return RuleOrField(b);}); var keys = ["pointsize", "z newsize"]; var find = '(' + keys.join("|") + ')\\s?=\\s?"?\\d*'; var pointsize = cf.match(new RegExp(find, 'gi')) || []; // Remove dups pointsize = pointsize.filter(function(item, pos) {return pointsize.indexOf(item) == pos;}); // Make them numeric values pointsize = pointsize.map(function(s){s = s.replace(/[^\d]/g,''); return StringToNumber(s);}); // Sort in ascending order pointsize = pointsize.sort(function(a,b){return (a > b) ? 1 : (a < b) ? -1 : 0;}); if (pointsize.length > 1) { var smallest = pointsize[0]; var largest = pointsize[pointsize.length-1]; mag_min = Round((pointsize_min/smallest)*100,0); mag_max = Round((pointsize_max/largest)*100,0); } var leadkeys = ["leading", "z newsize"]; var leadfind = '(' + leadkeys.join("|") + ')\\s?=\\s?"?\\d*'; var leadsize = cf.match(new RegExp(leadfind, 'gi')) || []; // Remove dups leadsize = leadsize.filter(function(item, pos) {return leadsize.indexOf(item) == pos;}); // Make them numeric values leadsize = leadsize.map(function(s){s = s.replace(/[^\d]/g,''); return StringToNumber(s);}); // Sort in ascending order leadsize = leadsize.sort(function(a,b){return (a > b) ? 1 : (a < b) ? -1 : 0;}); if (leadsize.length > 1) { var leadsmallest = leadsize[0]; var leadlargest = leadsize[leadsize.length-1]; leadmag_min = Round((leadsize_min/leadsmallest)*100,0); leadmag_max = Round((leadsize_max/leadlargest)*100,0); } // If the font's already larger than max, don't allow Copyfit it to increase it leadmag_max = (largest > leadsize_max) ? 100 : mag_max; // If the font's already smaller than the min, don't allow Copyfit it to shrink it leadmag_min = (smallest < leadsize_min) ? 100 : mag_min; // If the font's already larger than max, don't allow Copyfit it to increase it mag_max = (largest > pointsize_max) ? 100 : mag_max; // If the font's already smaller than the min, don't allow Copyfit it to shrink it mag_min = (smallest < pointsize_min) ? 100 : mag_min; if (!Copyfit(new MagnifyAttributes("text", mag_min, mag_max, pointsize_min, pointsize_max),new MagnifyAttributes("leading", leadmag_min, leadmag_max, leadsize_min, leadsize_max))) cf.content = '<span pointsize="' + minSizeCaption +'"><leading newsize="' + leadingSizeCaption + '">' + cf.content + '</leading></span>'; ReportWarning("Could not copyfit text in flow " + FusionPro.Composition.CurrentFlow.name); } This second code works, as long as the text does not exceed the number of characters that can be copyfit. Meaning if 100 characters can be copy, my text is reduced to match minimum leading and pointsize. However, if I enter 101 characters, the text is displayed at the Max point size and Max leading. I want to modify this code so that if anything text containing more characters than can be copyfit, to use the minimum for both point size and leading. I have attached a PDF sample downloaded from MarcomCentral showing the textboxes in question as well as a zip of my template. I have applied this Copyfit code to three text frames: FrontPhotoCaption, BackPhotoCaption-1 and BackPhotoCaption-2. These frames are found on page 1 and Page 4 of my template. In the sample provided, you will see two text sections on the bottom of the second page. The first section on the left has 239 characters and the right has 237. The right box adjusts the text correctly if the content needs to be adjusted. I think the biggest issues I'm having is that the pointsize to leading is not proportional, and when the pointsize is reduced to the smallest size in, the text boxes I'm working with wouldn't fit any more text with the reduced leading, but my client wants to be sure the smallest pointsize and leading are both used if once copyfit reaches it minimum for either. Thanks in advance for your help! Jason paad50hd.pdf CCHMC Newsletter_BluePurple_FINAL.zip
  6. Step, Think I got this working correct to cover all fields! Thanks so much!!!
  7. I've been struggling to find a way to keep my font size at the minimum font if copyfit does not fit. The way I see copyfit working in my template, one of three outcomes occur: 1) Text fits, copyfit not needed. No font sizing adjustments. 2) Text exceeds frame. Copyfitting is used, reducing font as needed until minimum font size is met. In this specific scenario, the reduced font size fits the frame, so copyfitting is successful. 3) Text exceeds frame (by a lot). Copyfitting fails. Text output displayed at default. I'm trying to fix scenario #3 so when copyfit is used, the font will always stay at the minimum size and will not increase back to default on Copyfit fail. Does this make sense? Zip file included just in case. CCHMC Newsletter_BluePurple_FINAL.zip
  8. For some reason, when I link the frames, it turns the textwrap button off. As for the text, it's at 80% black, so when I download the press proof, I select the text and delete it, but it's still there. So I select it and delete it again, and it's still there. Finally after the text appears 80% black onscreen (which it may only be an onscreen issue), and if I delete this text, the all MainArticleBodyCopy on the first page gets deleted. So suppression isn't working because of the three layers of text on the first page. So I'm not sure what to fix. var frontNum = Field("Front Design").slice(-1, -1); var backNum = Field("Back Design").slice(-1, -1); for (var f = 1; f <= 2; f++) { for (var b = 1; b <= 2; b++) { var enable = (f == frontNum && b == backNum); FindTextFrame("MainArticleBodyCopy" + f + "-" + b).suppress = !enable; } } I modified the code about as all pages are named Front-1, Front-2, Front-3, Back-1, Back-2, Back-3 and all frames are named MainArticleBodyCopy1-1 and all nine combinations through MainArticleBodyCopy3-3. Thanks!
  9. So it turns out I'm having a little trouble with this.... It's working very well to ensure that the 2nd page text always appears at the top of the page if the content doesn't fit on page 1, but I am having issues getting the content to flow if page 1 wraps to page 2. I had to make a modification because page 2 content was starting one line down from the top of the text frame due to the p tag. I made adjustments so that the Heading 1 would align to the top. But now the issue is that I can't get the headings to wrap if the page 1 content flows. Can you take a look and help me out? CCHMC Newsletter_BluePurple_FINAL.zip
  10. That's great to know! I had tried to figure out a way to apply this to all fields easily but was not able to get it to work properly. This rule converts single and double quotes to typographer quotes and is used for all fields (even number only fields... per client request). The last nine rules in OnRecordStart was meant to suppress the unused frames, the same with the code you have provided. The Text Wrap is trying to set textwrapping for the linked frames. The back option #3 (page 6) has an photo and a text frame. I was trying to get the text to wrap around the photo and text so that copyfitting will work appropriately, instead of just moving the photo and text to the front layer. Is it possible to set textWrap to true for linked frames? I'm also not having much success with the suppression rule you provided. I feel like I only need a portion of the code since linking the frames converts the BackBodyCopy frames to MainArticleBodyCopy1-3. FindTextFrame("MainArticleBodyCopy" + f + "-" + b).suppress = !enable; and delete: FindTextFrame("BackBodyCopy" + f + "-" + b).suppress = !enable; I can tell that text is not suppressed because the output files contains darker text on the front page, due to the multiple layers on the first page. But I'm not sure why it's not working. Any suggestions? Thanks! Jason
  11. I have a simple two page newsletter, front and back. Users will choose one of three design options for the front, and one of three options from the back. Text flows from the main area on the front to the main text area on the back. I'm at the point where I am setting up the text flow. On page 1, the text frame is named "MainArticleBodyCopy". The text frames on back are "BackBodyCopy", "BackBodyCopy2" and "BackBodyCopy3". I am trying to figure out how to setup the flow so that a user selects Front-1 and Back-2 (BackBodyCopy2), that these text boxes are linked. The problem I am having is that I can only link one frame to one frame. So after I setup "MainArticleBodyCopy" to "BackBodyCopy2", it loses the link to "BackBodyCopy" The only way I can think to accomplish what I need would be to copy the MainArticleBodyCopy frame three times, and rename it. Then link one frame to the BackBodyCopy, another frame to BackBodyCopy2 and the Third layered frame to BackBodyCopy3. Then I would repeat this on Front-2. If I do this, I would have 3 MainArticleBodyCopy on pages 1-3 and 9 BackBodyCopy frames on each of the back three pages. Is there another (or better) way to do this? I have attached my collected zip file. Thanks! CCHMC Newsletter_BluePurple_FINAL.zip
  12. Thanks Guys! This helps clear things up. I feel like I have to say this... But I'm am 100% with you both on this! But it's not always that simple to explain this to clients!!! This particular client has actually take a rule to Proofs we have provided in the past to make sure the output matches the design exactly. They have had me change templates by literal millimeters. The other client related problem is that they would allow users to have many options when creating these templates, but they want to be sure the designs are limited in differences for consistency. This is just one of the sections they have expressed multiple opinions about so I was try to keep all the text frames the sizes they had designed but implementing the design features they have requested. Tough job... Anyway, I'm was going to try Dan's "A better CopyfitLine", http://forums.pti.com/showthread.php?t=84, setting the widthInPoints to 7200, but I'll just go with adjusting the frame size and hope I can convince our client they don't want any changes. Thanks! Jason
  13. I would like to specify which text frames do not wrap text. I would like all other frames to wrap other than the ones I have named MiscNewsletterInfo, MiscNewsletterInfo2, etc. I have each other text frame's copyfit rules defined in the OnCopyFit rule, as I am defining Font Size and Leading mins and max for each text frame individually. Since I am already setting copyfit setting for each individual frame, I believed I could add some code to ensure that text for the MiscNewsletterInfo frame will always 11 point font, 15 point leading and will not wrap, causing the texts to be shifted from the Vertical Align Center position. The issue I have, even when copyfit is turned off, is that the text frame that is being converted is 32point in height and the text is only 11 points. I am trying to keep to the clients design as closely as possible without manually re-positioning text frames. I would prefer to code this particular text frame to only appear as one line of text at 11 point font. My other option is to determine the exact height and position of the text frame to prevent any tiny shift in the text position that occurs because a new line of text is introduced and tries to shift to align to the top, since the all text is not able to align center vertically. In my screenshot, when the width of the text at 11point exceeds the width of the textbox, you can see the text in frame 1 and 3 become aligned top instead of centered vertically. Does this make more sense? Sorry I have difficulty explaining this. 219809_POD_NewsletterTemplate_BluePurple TEST FILE.zip
  14. Ok, Sorry Dan. I knew a sample would help, but my file is all over the place at the moment because I'm going through to build the definition file with all my variables and rules first, as the template is much more involved than I explained. Attached is both screenshots and the PDF. The screenshot has three text areas numbered 1-3. These represent a line of text that can appear on one of three pages, chosen by the user. As you may see, the width of these text boxes if different. Our Client wants to ensure that the text in all 3 boxes remain at 11 point font with 15 point leading. This text is to stay on one line, in in the middle of the textbox vertically. The textboxes numbered 1 and 3 wrap text. How can I truncated any text that would wrap for multiple text frames that use the same variable/rule (both variable and rule are named the same)? Also, since I copied the text Frame, they are also named the same so I have the copyfit measures set in OnCopyFit. I also tried an OnRecordStart to set the textWrap == false, but I think that's more for wrapping around other frames and graphics. For some reason I thought there was a CopyFitLine or something that did this too. Thanks! Jason 219809_POD_NewsletterTemplate_BluePurple TEST FILE.pdf
  15. I feel like I have come across a solution for this recently, but I can never reproduce it easily. I have a newsletter template, where there is a title and an informational line below the title can only be one line and the font size is set to 11 points. The catch is that the textbox is aligned vertically in the middle. So if text wraps, the text shifts up a bit. I was able to get the following code to work for the most part, however the issue I still have is that the text size can be reduced to fit the the width, but I'm trying to keep the font size at 11 points. CopyfitLine(Field("Misc Newsletter Info"), "", "Proxima Nova A Medium", 11, 10000, 11, false) I was trying with copy fit because I saw it work recently in another template of mine, but I can't reproduce it to ensure the text stays on only one line and does not wrap. I feel like I'm missing something easy like the "Do not break on Copyfit" checkbox, but that did not seem to do the trick with the one line of text. Thanks! Jason
×
×
  • Create New...