Jump to content

Text overflow problem


Bill McCarthy

Recommended Posts

When I specify a variable field in a text box that contains more characters than will fit in the box, nothing prints. I have selected "discard text that does not fit" but it discards everything, even the text that fits. When I select "overflow text to new pages" it similarly overflows the entire text, not just the text that doesn't fit. Is there a way to remedy this?
Link to comment
Share on other sites

Hello,

Is the text pulled in from a field in your data file? If so, try this option.

I'll try my best to answer your questions and walk you through the steps

quickly.

 

Below are the steps to take in Fusion Pro to create a formatted text

resource and then insert it into your rule.

1) Go to the following menu options in at the top of your tool bar in

fusion pro (FusionPro - Palettes - Steps)

2) When the "Steps" palette opens hit the second button down "Create

Resources". This will open the resource dialog box.

3) Name your resource something you can recognize. In the "Type" drop

down menu choose "Formatted Text". Hit the "Edit Button".

4) This will open a window that looks and works exactly as the variable

text frame editor so that you can add and format you paragraph along

with the variable. Once this is completed save and close out of all of

these windows. You have created a formatted text paragraph.

5) In the "Steps" palette go to the "Create Rule" option and create the

rule as you normally would. To insert the formatted text resource open

your "Building Blocks" and click on the tab at the top that says

"Resource". Your new formatted text resource should be listed here the

way that you named it and you can insert it exactly as you would insert

a variable field.

6) Then insert your rule into your variable text frame. Remember that

your rule will contain your paragraph.

 

 

Link to comment
Share on other sites

If you want to fit text to a single line, you can just use the

CopyfitLine function.

If you want to fit to a different number of lines, you will need to roll

your own copyfit logic using the FusionProTextMeasure object.

 

Basically, most copyfitting involves iterations of measuring some text,

then modifying its size and measuring again, until it fits. The

<magnify> tag can be very helpful in this regard.

Here's a function that should work:

 

 

function CopyfitToLines(text, widthInPoints, numLines, magnifyType)

{

var MagnifyType = magnifyType || "text";

var NumLines = Int(numLines) || 1;

var tm = new FusionProTextMeasure;

tm.maxWidth = widthInPoints*100;

var retcode = 0;

var factor = 100;

var tags = text;

 

for (var factor = 100; factor >= 10; factor--)

{

if (factor != 100)

tags = "<magnify type=" + MagnifyType +

" factor=" + factor + ">" +

text + "</magnify>";

retcode = tm.CalculateTextExtent(tags);

if (tm.messages)

ReportError("CopyfitLines: " + tm.messages);

if (retcode != 0)

break;

if (tm.textLines <= NumLines)

return tags;

}

ReportWarning("CopyfitLines failed to fit the text");

return text;

}

 

 

The last two parameters are optional. Note that the font name, point

size, and anything else affecting the measurement must be specified in

the tags.

Here's an example of calling it:

 

var text = "<f name=Arial><z newsize=36>" +

Field("FName") + " " + Field("Lname") + " of " +

Field("City") + ", " + Field("State");

return CopyfitToLines(text, 200, 2);

Link to comment
Share on other sites

It's hard to say what you need to change without looking at the job, since there are a lot of things that affect how text is kept together. I would start by taking a look at the "Widows" and "Keep with next paragraph" settings in the Paragraph Formatting dialog.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...