Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text


Thread Tools Search this Thread Display Modes
Old August 21st, 2009, 01:22 PM
JetGraphicsArtDept JetGraphicsArtDept is offline
Forum n00b
Join Date: Jun 2009
Location: Miami, FL
Posts: 1
Default Frames Move Down to Center Information


Of course I know I might not make any sense to some of you because am a newbie at FP. So I apologize in advance

Ok...this is my issue. I work mainly formatting business cards for our clients.

My layout consist of am static image on top in the center.
Then comes my first frame with the client name and/or title. Of course if they have no title the Name suppresses to the center.

My bottom left frame consist of addresses...Sometimes only one address is needed so it suppresses to the bottom of that frame. My right frame does the same but has the clients Phone #'s and email address...Now sometimes one frame may be larger then the other based on the information the client inputs. (Ex.: there's 2 addresses on the left side but just a Phone # on the right side)

So here is where I get stuck I need for my frame with the Name and/or if titles to be able to center between the static image and the frames containing the addresses and numbers...if the bottom frames(Addresses and Phones) only have less information then normal. (Ex.: 1 Address and just the phone #).

Can anyone help me out???

Bigs thanks in advance!
Reply With Quote
Old August 21st, 2009, 02:50 PM
esmith's Avatar
esmith esmith is offline
Senior Contributor
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 869
Default Re: Frames Move Down to Center Information

I imagine there is probably a way to write a piece of code to measure copyfit of bottom two text fields and apply positioning of name/title based on that information, BUT I don't know how to do that.

What MIGHT work is to adjust leading of name/title field using tagged text based on whether either text field at bottom of card contains 2 lines of data or not. I'm assuming that each possible line in a text field refers to a separate field in your data (i.e. no one field contains 2 lines of data). Correct?

If so, then your card would resemble:


Field("Address1")                    Field("Phone")
Field("Address2")                    Field("Email")
From here your (admittedly rigged) JS code would be:
var pointSize = 10; //enter point size of your text
var adjustLeading = pointSize*20; //leading is doubled (converted to tenths of points)
var totalLines = 2;

if ((Field("Name") == "") || (Field("Title") == "")) {
   totalLines = 1;

if (Field("Address1") == "" || Field("Address2") == "") && (Field("Phone") == "" || Field("Email") == "") {
   if (totalLines == 2) {
      return "<leading newsize=adjustLeading>" + Field("Name") + "<br />" + Field("Title") + "</leading>";
   else if (Field("Name") == "") {
      return <leading newsize=adjustLeading>" + Field("Title") + "</leading>";
   else return <leading newsize=adjustLeading>" + Field("Name") + "</leading>";
else return Field("Name") + "<br />" + Field("Title");
Remember to check the "Return as tagged text" box and set your center variable text box to center vertically between bottom of graphic and top edge of 2-line text frames along bottom.

The code should leave text in center frame centered if either text frame at bottom contains 2 lines of text. If both bottom frames include only 1 line of text, the text in center will have altered leading to push it down a little further on card to compensate. You may have to play with the numbers in the rule to get the centering to be just right.

If this doesn't work, hopefully someone more skilled in actual copyfitting will provide the "correct" answer!
Eric Smith
Content Developer
FP 9.3.6, MAC OSX 10.9.4, Acrobat 11.0.09
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 03:43 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.