Jump to content

Alignment


tonyb

Recommended Posts

I have done some searching but am coming up empty. I just need a simple rule that allows me to have a text variable change the text alignment of a poster text. What is the alignment tag I need to use here?

 

I want something like If field alignment=centered than return centered text.

 

Let me know what the tag is or where I can find an answer to this, thanks!

Link to comment
Share on other sites

Tony,

 

The tags for paragraph alignment are as follows

 

<p quad="C" . . . . . . .> for centring

 

<p quad="R" . . . . . . .> for right justified

 

<p quad="J" . . . . . . .> for full justified

 

<p quad="L" . . . . . . .> for left justified

 

Most all the coding can be found in the Tag Reference Guide that Printable provides, or a quick and dirty way would be to create a Formatted Text resource and type what you want and then format it in the text editor how you would like it to appear. Then in the Resource Editor click the button that says "view source" and you can see the tagged source code that FusionPro created for what you created in the text editor. It will show EVERYTHING whether it is used or just the default values. Color, fonts, alignment, leading, format styles, skipifempty, indents, other rules or resources, ...EVERYTHING. And it will show you how to program them. This section can't be edited, but it can be copied and pasted into other places. It's great for creating tagged-text files than can be used as resources. Just create what you want, view it, then copy and past it into wordpad and save it as a separate .txt file. Then if you ever need to change something like a disclaimer, disclosure or a copyright statement from year to year but nothing else changes in the template, you just need to update this external text file and NEVER have to touch the template.

 

Good Luck.

Link to comment
Share on other sites

Thanks for that great answer, David. Yes, the Tags Reference Guide is your friend.

 

You can also use the "br=false" attribute on the <p> tag to change the formatting of the current paragraph without starting a new one. For instance: <p quad=C br=false>. Or in a rule:

if (Field("alignment") == "centered")
 return "<p quad=C br=false>";

Link to comment
Share on other sites

I had looked in the tags guide but did not realize what the quad command was, the description did not mention alignment at all. I had not used the text resource to look at the code before, that's a very useful trick. Thanks to both of you for the help!
Link to comment
Share on other sites

I had looked in the tags guide but did not realize what the quad command was, the description did not mention alignment at all.

Sorry about that. "Quadding" is an old-fashioned printing term. I've entered a case (FP-11149) against the documentation to make it more obvious that the "quad" attribute affects paragraph alignment.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...