Jump to content

Frames Move Down to Center Information


Recommended Posts



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 :D 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!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites


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

  • Create New...