Jump to content

Changing font color of text frame


Recommended Posts



I've been trying to figure out a way to change all of the text within a text frame based on the contents of a field using an OnRecordStart callback rule. So far no luck. Basically, I have a text frame with several variables in it using a white font on top of a graphic frame. I need to be able to change the font color depending on the background image that gets loaded into the graphic frame, since several have a white background.


Any help is appreciated.

Link to comment
Share on other sites

In FusionPro 6.0 or later, you can name the text frame and then do something like this in OnRecordStart:

var myFrame = FindTextFrame("Story");
myFrame.content = "<span color=Green>" + myFrame.content;

However, there's a somewhat simpler solution that will work in any (currently supported) version of FusionPro, without creating an OnRecordStart rule. You can just create a regular text rule like so:

return "<span color=Red>";
// Don't forget to check "Treat returned strings as tagged text." 

Then you can insert the variable with the rule's name at the very start of the text in the frame (in the Variable Text Editor).


To use a color name from a data field, just change the rule to do something like this:

return '<span color="' + Field("TextColor") + '">';

Link to comment
Share on other sites

I can't believe I wasted so much time and all I needed was "span"! I was trying to do it the same way you have it except I wasn't using that one little word. What a relief to be past that issue. Thanks for the help.
Link to comment
Share on other sites


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

  • Create New...