Jump to content

Format text to have different leading in on same line


Recommended Posts

Hello Everyone,

Need some help. I have script below and not sure how to implement my next step. Based on script below I'm trying to print a box using winding font then print some text after it. The problem is my text aligns to the bottom of the box/line and my client wants the text to print at the middle part of the box similar to a superscript effect. I attached a small pdf file if that would help. Can anyone help?

//Notes: psubox is a little square box ..fusionpro does not have a drawbox function/command so I had to use a font character

 

var psubox = '<f name = "Wingdings 2">' + '<z newsize = "18">' + "*" + '<f name = "Courier New">' + '<z newsize = "6">' + '&nbsp;'+ '&nbsp;';

 

var gd = psubox + Field("FIELD66") + '&nbsp;' + '&nbsp;' +'&nbsp;' + '&nbsp;'+ Field("FIELD67") +'<br>' + psubox + Field("FIELD53") + '&nbsp;' + '&nbsp;' +'&nbsp;' + '&nbsp;' + Field("FIELD52") +'<br>' + psubox + Field("FIELD55") + '&nbsp;' + '&nbsp;' +'&nbsp;' + '&nbsp;'+ Field("FIELD54") + '<br>' + psubox + Field("FIELD57") + '&nbsp;' + '&nbsp;' +'&nbsp;' + '&nbsp;'+ Field("FIELD56") + '<br>' + psubox + Field("FIELD59") + '&nbsp;' + '&nbsp;' +'&nbsp;' + '&nbsp;'+ Field("FIELD58");;

 

return gd;

Alignment.pdf

Link to comment
Share on other sites

18 minutes ago, Cody Williams said:

similar to a superscript effect.

Well, instead of doing something similar to superscript, you could actually use superscript.  Though it may be simpler to just subscript the box, like so:

var psubox = '<f name = "Wingdings 2">' + '<z newsize = "18">' + "<subscript>*</subscript>" + '<f name = "Courier New">' + '<z newsize = "6">' + '&nbsp;'+ '&nbsp;';

And you can modify the subscript ratio and offset in the Paragraph Globals dialog, or with attributes of a <p> tag, such as '<p br=false suboffset=30 subratio=200>'.

Though I would have taken a different approach to this completely, such as a table.  If you make the table correctly, you don't need the Wingdings character for the box; that just becomes a table cell with an outline, and the cells with the text can have their vertical alignment set to middle.

Or, you could use a repeatable component, and make a separate graphic frame for the box, which again, can just be an empty square frame with a border.

27 minutes ago, Cody Williams said:

//Notes: psubox is a little square box ..fusionpro does not have a drawbox function/command so I had to use a font character

Even if you want to do this all as regular text, without a table or a repeatable component or anything, you can still use an inline graphic for the box.  And you could use <t> tags and set tab stops instead of all those '&nbsp;' entities.

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