Jump to content

Do Not Want Text to Wrap


kkeiz

Recommended Posts

Hello,

 

I have several variables in the same text frame and I don't want the text to wrap to another line if it doesn't fit. I also don't want to use copyfitting as I don't want the point size to change. The text needs to be truncated if too long.

 

Variables in text frame:

<FirstName><MiddleName><Last Name>

<Title>

 

Data File Values:

FirstName: Samantha

MiddleName: M.

LastName: Smithwicks-Jefferson

Title: Administrator; Broker; Realtor; Office; Manager; Owner; President

 

I have tried the text measurement code from another posted thread and it did work when I wrote the rule for the <Title> line field - but does not work correctly for the NAME line fields which are nested in the same rule - see blue in code below:

__________________________________________________

function TruncateText(text, font, pointSize, width) // width and pointSize in hundredths of points

{

var TM = new FusionProTextMeasure;

TM.useTags = false;

TM.maxWidth = width;

TM.font = font;

TM.pointSize = pointSize;

 

for (var partial = text; partial; partial = partial.substr(0, partial.length - 1))

{

TM.CalculateTextExtent(partial);

if (TM.textLines <= 1)

return partial;

}

throw "Nothing fits";

}

 

return TruncateText('<uppercase>' + (NormalizeEntities(Field("FirstName")) + " " +

(Field("MiddleName")) + " " + (Field("LastName")) + '</uppercase>'), "Aller Bold", 1000, FindTextFrame("Untitled1").GetSettableTextWidth());

__________________________________________________

 

Here is the result when I compose:

SAMANTHA M. SMITH

Administrator; Broker; Realtor; Offi

 

The name line is breaking too short - it should be truncating the same width (approx.) as the title line above. It does seem to break correctly when I remove <uppercase>, but I need the name in all caps. Also, depending on where I placed <uppercase> I was getting different results in where the names broke.

 

Any assistance would be appreciated. My apologies for the length of this message!

Link to comment
Share on other sites

It does seem to break correctly when I remove <uppercase>, but I need the name in all caps. Also, depending on where I placed <uppercase> I was getting different results in where the names broke.

You have tags in the text you're measuring, so you need to change the second line of your function to:

TM.useTags = true;

The other option is to leave that set to false and remove all the tagging from the text. You do this by removing the call to NormalizeEntities, and, instead of using tags, using a JavaScript function to turn the text to uppercase, like so:

return TruncateText(ToUpper(Field("FirstName") + " " +  Field("MiddleName") + " " + Field("LastName")), "Aller Bold", 1000,  FindTextFrame("Untitled1").GetSettableTextWidth());

Link to comment
Share on other sites

I have a pdf file made in Corel Draw which was supplied by the customer. It's a simple numbering job wherein the text box I created from Fusion Pro is not transparent and seem to be mirroring. I have to flatten the file in photoshop in order get the numbering sequence properly. Is there something I can do within the pdf to avoid this mirroring issue or the file created from Corel should be buried with Windows Vista.

Tried preflighting and didn't work.

 

I'm on Fusion Pro Ver. 9.1.0

Windows 7

Guest Meal Ticket-template-preflight.pdf

Link to comment
Share on other sites

I have a pdf file made in Corel Draw which was supplied by the customer. It's a simple numbering job wherein the text box I created from Fusion Pro is not transparent and seem to be mirroring. I have to flatten the file in photoshop in order get the numbering sequence properly. Is there something I can do within the pdf to avoid this mirroring issue or the file created from Corel should be buried with Windows Vista.

Tried preflighting and didn't work.

 

I'm on Fusion Pro Ver. 9.1.0

Windows 7

Please start a new thread with a new question, instead of replying to an existing thread.

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...