Jump to content

Overflow, chained text frames, copyfitting multiple text frames


Recommended Posts

I have a two page document with text on the front and back.

 

The front has a lot of room for copy, but should be allowed to flow to the back. The variable on the front is the Main Text.

 

The back copy is uses subheading and sub text. These subheadings should always appear on the back, even if there is not enough text to fill the Main Text frame.

 

I have tried setting this up with both Overflow and linking the frames together. Overflow kind of works, except the second page is suppressed if not enough text flows to the back frame. I tried setting up a script to ensure that back text appears in the back text frame. I tried something like this:

 

return Field("Main Text") + FindTextFrame("BackBodyCopy").content = Resource("Back Body Text Resource");

 

 

As for as linking the text frames, that almost works better, except the back content flows to the first page if the main text does not fill the first frame.

 

 

Is there a way to allow text flow from frame 1 to frame 2 but also not allowing text from frame 2 to flow to frame 1?

 

 

Thanks!

Jason

Link to comment
Share on other sites

There may be an easier way to accomplish this, but you could probably get the results you want by using linked text frames and the "verticalstart" attribute of the paragraph tag.

 

You'd create a rule that returned the content of both pages joined by a paragraph tag that forces the contents of the back page to start at the top of the "next page". If the contents of the front page overflows onto the second page, starting the back contents on the "next page" effectively tells the text to overflow to a 3rd linked frame and since a 3rd linked frame doesn't exist, the text won't fit.

 

So, we can modify the OnCopyfit rule to check whether or not the text fits. If it fits, we can assume that the front page did not need to overflow to the second page, if it doesn't fit, we need to remove the "verticalstart" attribute from the paragraph tag so that it will fall inline with the overflowed text.

 

Here's an example:

Text Rule:

var spaceBetweenParagraphs = 1000; // 1000 = 10 pts
var front = 'Tofu palo santo bespoke kombucha, leggings health goth prism VHS everyday carry adaptogen actually asymmetrical iPhone single-origin coffee. Tote bag subway tile gochujang cliche schlitz tattooed XOXO, succulents edison bulb hella. Tote bag banjo iPhone, actually selvage fixie gochujang hell of retro palo santo taxidermy keytar microdosing ethical normcore. Next level ennui truffaut taiyaki, food truck chartreuse you probably haven\'t heard of them iceland. Enamel pin kickstarter meditation locavore. Actually lo-fi succulents, dreamcatcher slow-carb cray viral activated charcoal gochujang irony af palo santo meggings tofu. Bushwick celiac keytar, affogato chia pour-over semiotics artisan chicharrones cold-pressed.'

         // Uncomment paragraphs below to demonstrate inline back page.
         // + '<p leadbefore="' + spaceBetweenParagraphs + '">Humblebrag yuccie craft beer semiotics sartorial forage pork belly polaroid, distillery hoodie. Neutra activated charcoal cronut quinoa pickled, whatever occupy. Humblebrag ramps tumeric forage, messenger bag meditation 90\'s synth. Kickstarter pork belly deep v, raw denim activated charcoal vaporware synth. Umami cornhole hoodie, live-edge letterpress small batch hella vexillologist. Af venmo food truck fap, plaid cardigan edison bulb tilde. Art party tofu health goth vaporware sustainable.'
         // + '<p leadbefore="' + spaceBetweenParagraphs + '">PBR&B beard pitchfork, bushwick tumblr meggings blue bottle man braid pop-up la croix aesthetic tote bag post-ironic yr. Selfies intelligentsia poke plaid, pinterest live-edge tattooed banjo typewriter flannel photo booth bitters drinking vinegar. Tumblr meggings lyft authentic, raw denim af biodiesel 3 wolf moon semiotics banh mi health goth squid. Copper mug offal sartorial hell of gentrify, air plant kinfolk crucifix adaptogen austin affogato la croix. Tumeric live-edge tacos literally williamsburg, DIY roof party raw denim cardigan jianbing irony austin deep v. Quinoa kickstarter church-key, schlitz raclette stumptown gluten-free ugh mlkshk neutra helvetica tattooed small batch. Intelligentsia stumptown hashtag, cronut wolf pinterest YOLO 90\'s taxidermy VHS wayfarers tattooed raw denim franzen master cleanse.'
         // + '<p leadbefore="' + spaceBetweenParagraphs + '">Coloring book salvia health goth wayfarers edison bulb, church-key actually you probably haven\'t heard of them tote bag beard twee chillwave 3 wolf moon hoodie. Farm-to-table locavore roof party cray. YOLO banjo man braid ugh cloud bread. Microdosing everyday carry cred, mixtape master cleanse hexagon snackwave you probably haven\'t heard of them kombucha gentrify chicharrones bicycle rights ugh fixie letterpress. Enamel pin poke letterpress, pour-over prism mixtape echo park kickstarter hexagon artisan copper mug offal blue bottle crucifix. Palo santo microdosing blog, ethical irony lomo single-origin coffee swag hashtag raclette farm-to-table blue bottle selfies master cleanse chartreuse. Leggings lo-fi yuccie, lyft umami mustache polaroid snackwave celiac.'

var back = 'Literally chartreuse master cleanse, tilde glossier locavore put a bird on it VHS succulents celiac craft beer. La croix direct trade readymade organic mixtape, kitsch 8-bit blog iPhone try-hard live-edge slow-carb. Flexitarian polaroid forage cold-pressed, occupy poutine portland tacos vice gastropub. Everyday carry dreamcatcher health goth next level neutra kombucha, heirloom tousled affogato pork belly retro. Irony chambray occupy, gastropub keytar woke four loko butcher ugh vinyl tumeric umami man bun lumbersexual edison bulb. Literally ethical readymade activated charcoal, knausgaard PBR&B mixtape small batch hashtag woke. Blue bottle readymade semiotics, jianbing fashion axe keytar craft beer plaid keffiyeh lyft actually iPhone 8-bit.';
return [front, back].filter(String).join('<p verticalstart="topofpage">');

 

OnCopyfit:

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"', '');
   });
// Regular Copyfitting...
if (!Copyfit(new MagnifyAttributes("text", 25, 400, 6, 72)))
   ReportWarning("Could not copyfit text in flow " + cf.name);

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...