Topic Options
#36242 - 06/03/11 01:07 PM Bold and underlines
Nuno Delgado Offline
OL Newbie

Registered: 06/03/11
Posts: 5
Loc: Portugal
Hi there,

Is it possible to create a condition that changes the font type?

Top
#36244 - 06/03/11 01:34 PM Re: Bold and underlines [Re: Nuno Delgado]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
Nuno,

While there is no way to conditionally change the font applied to a variable, there is a little trick you can use.

The idea is to place two variables in your text box, next to each others. Then each variables can have a conditional expression. They will display some text if the expression is true, and nothing if it's false. After that, you can go in the text box, and apply a different font and style to each of the two variables.

This means that on each record, only one of the two variable will be displayed, and though they might have the same value, they will have a different font, thus simulating a conditional fonts change.

Hope that helps!

Regards,
Raphaël Lalonde Lefebvre

Top
#36245 - 06/03/11 01:35 PM Re: Bold and underlines [Re: ]
Nuno Delgado Offline
OL Newbie

Registered: 06/03/11
Posts: 5
Loc: Portugal
Hi Oliver.

Can you give me an example how to do it?

thanks.

Top
#36246 - 06/03/11 01:37 PM Re: Bold and underlines [Re: Nuno Delgado]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
Nuno,

Please see my post. The previous post was mistaken for an expression for our other software. Let me know if you have questions!

Raphaël

Top
#36247 - 06/03/11 01:46 PM Re: Bold and underlines [Re: Raphael Lalonde Lefebvre]
Nuno Delgado Offline
OL Newbie

Registered: 06/03/11
Posts: 5
Loc: Portugal
hi Raphael,

The problem is that my client send me a observation field that have HTML Tags to indicate how he wan´t the word. For example:

ASASdsadadad <CR><B>dsjkfgdjk:</B> kfjksdhffksdhjf

results like this:
ASASdsadadad
dsjkfgdjk: kfjksdhffksdhjf

Top
#36248 - 06/03/11 02:03 PM Re: Bold and underlines [Re: Nuno Delgado]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
I see... Unfortunately, PrintShop Mail does not do recognition on HTML tags, and it is not possible to dynamically change the font of the text of a variable using HTML tags like this.

Raphaël

Top
#36249 - 06/03/11 03:43 PM Re: Bold and underlines [Re: Raphael Lalonde Lefebvre]
Sander vd Berg Offline
OL Expert

Registered: 06/10/08
Posts: 197
Loc: Objectif Lune NL
PrintShop Mail doesn't recognize HTML tags, but it does recognize RTF tags. You could try replacing the HTML tags with the corresponding RTF tags; this should allow you to dynamically change the font based on an expression.

Try the following expression as an example:

"{\rtf1 " & "NORMAL" & "\par\b " & "BOLD" & "\par\b0\ul " & "UNDERLINED" & "\par\ul0 NORMAL" & "}"

Result:

NORMAL
BOLD
UNDERLINED
NORMAL

Some things to note:

- The result of the expression must start with "{\rtf1" and end with "}", otherwise it will not be recognized as RTF
- "\par" is the RTF token for a hard return (new paragraph)
- "\b" turns bold style on, "\b0" turns it off again
- "\ul" turns underline style on, "\ul0" turns it off again
- There should be a space character separating any RTF tokens and regular text

This functionality is not documented, so you'll have to experiment a bit. It's pretty neat though, you can also dynamically change the text color or font size, for example.

Top
#36250 - 06/03/11 04:24 PM Re: Bold and underlines [Re: Sander vd Berg]
Sander vd Berg Offline
OL Expert

Registered: 06/10/08
Posts: 197
Loc: Objectif Lune NL
Sorry, I just realized that this only works in PSM 7, and you posted in the PSM 6 forum.

Top