Jump to content

Changing Vertical alignment of text


gschoeman

Recommended Posts

Hi there,

I am having difficulty getting a line of title text to change vertical alignment in a text box. I want the customer to be able to choose between Top, Center and Bottom in a pick list. I have rules built to change the font style, colour and size and they are all working fine.

 

The rule I am trying for the vertical positioning of the text is:

 

if (Field ("TitlePosition") == "Top")

return "<p vAlign=Top p>";

if (Field ("TitlePosition") == "Center")

return "<p vAlign=Middle";

if (Field ("TitlePosition") == "Bottom")

return "<p vAlign=Bottom p>";

Link to comment
Share on other sites

Hi there,

I am having difficulty getting a line of title text to change vertical alignment in a text box. I want the customer to be able to choose between Top, Center and Bottom in a pick list. I have rules built to change the font style, colour and size and they are all working fine.

 

The rule I am trying for the vertical positioning of the text is:

 

if (Field ("TitlePosition") == "Top")

return "<p vAlign=Top p>";

if (Field ("TitlePosition") == "Center")

return "<p vAlign=Middle";

if (Field ("TitlePosition") == "Bottom")

return "<p vAlign=Bottom p>";

I'm not sure where you got the idea that "vAlign" is a valid attribute of the <p> tag. There's nothing about that in the Tags Reference Guide. In any case, conceptually, vertical alignment is not really an attribute of a particular paragraph; rather, it's an attribute of a text frame.

 

If you're using FusionPro 6.0 or later, changing the vertical alignment of a text frame is a snap. All you need to do is give the frame a name and do this in OnRecordStart:

FindTextFrame("MyFrameName").verticalAlignment = Field("TitlePosition");

In earlier versions of FusionPro, you can use Text Measurement and tables to accomplish something similar, but it's really much easier in 6.0.

Link to comment
Share on other sites

Dan,

How can you adjust verticle alignment within table cells? Can you post some examples of how we can use Text Measurement functions? I believe there is a lot of power in these functions but there is not much reference in the help documentation.

 

P.S. vAlign is a CSS HTML function for verticle alignment. Since not all JS available in FP is covered in the FP documentation those of us out in the field just try things. Sometimes they work. Sure that was not JS but I applaud the effort on gschoeman's part. I use quite a bit of functions and script that's not covered in the manuals.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...