Bold and underlines

Posted by: Nuno Delgado

Bold and underlines - 06/03/11 01:07 PM

Hi there,

Is it possible to create a condition that changes the font type?
Posted by: Raphael Lalonde Lefebvre

Re: Bold and underlines - 06/03/11 01:34 PM

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
Posted by: Nuno Delgado

Re: Bold and underlines - 06/03/11 01:35 PM

Hi Oliver.

Can you give me an example how to do it?

thanks.
Posted by: Raphael Lalonde Lefebvre

Re: Bold and underlines - 06/03/11 01:37 PM

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
Posted by: Nuno Delgado

Re: Bold and underlines - 06/03/11 01:46 PM

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
Posted by: Raphael Lalonde Lefebvre

Re: Bold and underlines - 06/03/11 02:03 PM

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
Posted by: Sander vd Berg

Re: Bold and underlines - 06/03/11 03:43 PM

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.
Posted by: Sander vd Berg

Re: Bold and underlines - 06/03/11 04:24 PM

Sorry, I just realized that this only works in PSM 7, and you posted in the PSM 6 forum.