Jump to content

Prevent Text Wrap without Copyfit


Recommended Posts

I can think of two possible solutions:

 

1. Put that line of text in its own text frame. Put it at a layer below the main text frame, and fill the main text frame with a white background to obscure the extra text in the frame behind it. You'll have to adjust the position of the frame by hand relative to the frame containing the other text on the line, but if the font and point size are not changing, it should be doable. I've attached a sample job which does this.

 

2. Create a rule like the following:

 // In FusionPro 6.0 or later, simply replace the frame name here.
 // In a version before 6.0, you'll need to hard-code the width instead.
 var FrameWidthHundPts = FindTextFrame("Address").GetSettableTextWidth();

 // Change this to the desired font and size:
 var tags = '<f name="Arial"><z newsize=20>';

 // Change this to your field name:
 var full_line = Field("Company");
 var words = full_line.split(' ');

 var TM = new FusionProTextMeasure;
 TM.maxWidth = FrameWidthHundPts;
 for (var i = words.length; i > 0; i--)
 {
     var line = tags + "\n" +
                NormalizeEntities(words.slice(0, i).join(' '));
     TM.CalculateTextExtent(line);

     if (TM.messages)
         ReportError("Error measuring text: " + TM.messages);
     if (TM.textLines < 2)
         return line;
 }

 ReportError("Can't fit any words on the line!");

The first approach is going to compose faster.

blank.pdf

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...