Jump to content

Copyfitting two separate text frames to the same size


-Lisa-

Recommended Posts

Hi all,

 

Lately I feel all I post about is copyfitting! :rolleyes: I promise that will change soon!

 

Anywhoo...

 

I'm currently using the OnCopyFit rule in two separate text frames within the same template. I need to be able to write a rule that will alter the font in both frames to reduce to the same size. For instance, if the CopyFit rule is applied in Frame A and reduces the font from 48pts to 36pts, but in Frame B it reduces the font to 30pts, I need a rule that will reduce the font in BOTH Frame A and B to 30pts.

 

Thoughts?

 

Thanks!!!

Link to comment
Share on other sites

The short answer is no. The long answer is, well, long.;)

 

Technically, the Copyfit function called by the OnCopyfit rule doesn't reduce text to a particular size; rather, it scales all the text in the flow by a particular magnification factor. So it's not accurate to say that it "reduces the font from 48pts to 36pts." If you're using the default "text" magnification type, it's actually scaling everything in the flow by 75 percent, so any 10 point text in the same flow will become 7.5 points, etc.

 

At any rate, the exact magnification factor used for the copyfitting is not exposed, and even if it were, there's no way to control the order in which text flows are processed to make one flow's copyfitting dependent upon another's.

 

However, there is something that I think will work for what you're trying to accomplish: Connect the two frames into a single flow. But, you ask, doesn't that mean that all the text is lumped together, causing it to flow between both frames instead of being separated? Well, yes, it does. But there's a way around that. The <p> tag has an attribute "verticalstart" which can cause the paragraph to start at the top of the next column or page. In most case, the next column is the start of the next frame (unless you're using multiple columns in a frame). So you can make a rule like this:

return "<p verticalstart=topofcolumn br=false>";

and insert it in between the two sections of text in your two-frame flow, which had formerly been in two unconnected frames. This will cause the text after that tag to be pushed into the new frame, and the Copyfit function will still try to make everything fit by scaling all the text in the flow (in both frames) by the same magnification factor.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...