Jump to content
Insnee

Double Linebreak in RscStructuredText with parseText

Recommended Posts

Hello,

when I try to set the structured text with parseText

<t size='22' font='PuristaMedium'>SMS von %1</t><br/><t size='19' font='PuristaMedium'>Nummer: %2</t><br/><br/><t color='#ff979ba1' size='19' font='PuristaLight'>%3</t>

it only renders ONE (!) linebreak.

 

I have to use parseText and I want to have a double linebreak (so, a "blank" line)..

 

Is that even possible and how?

 

 

Regards,

Insane

Share this post


Link to post
Share on other sites

It does actually seem to break its just the line spacing seems to be a set amount.

Try this from the debugconsole..

_ctrl = findDisplay 46 ctrlCreate ["RscStructuredText", 1001];
_ctrl ctrlSetPosition[ safeZoneX, safeZoneY, safeZoneWAbs, safeZoneH ];
_ctrl ctrlCommit 0;
_ctrl ctrlSetStructuredText parseText format[ "<t size='8'>SMS von %1</t><br/><t size='8'>Nummer: %2</t><br/><t color='#ffff00' size='8'>%3</t>", 1, 2, "br" ];

_ctrl = findDisplay 46 ctrlCreate ["RscStructuredText", 1001];
_ctrl ctrlSetPosition[ safeZoneX, safeZoneY, safeZoneWAbs, safeZoneH ];
_ctrl ctrlCommit 0;
_ctrl ctrlSetStructuredText parseText format[ "<t size='8'>SMS von %1</t><br/><t size='8'>Nummer: %2</t><br/><br/><t color='#ff0000' size='8'>%3</t>", 1, 2, "brbr" ];
 
_ctrl = findDisplay 46 ctrlCreate ["RscStructuredText", 1001];
_ctrl ctrlSetPosition[ safeZoneX, safeZoneY, safeZoneWAbs, safeZoneH ];
_ctrl ctrlCommit 0;
_ctrl ctrlSetStructuredText parseText format[ "<t size='8'>SMS von %1</t><br/><t size='8'>Nummer: %2</t><br/><t size='8'> </t><br /><t color='#00ff00' size='8'>%3</t>", 1, 2, "            space" ];

_ctrl = findDisplay 46 ctrlCreate ["RscStructuredText", 1001];
_ctrl ctrlSetPosition[ safeZoneX, safeZoneY, safeZoneWAbs, safeZoneH ];
_ctrl ctrlCommit 0;
_ctrl ctrlSetStructuredText parseText format[ "<t size='8'>SMS von %1</t><br/><t size='8'>Nummer: %2</t><br/><t size='8'> </t><br/><t color='#0000ff' size='8'>%3</t>", 1, 2, "nbsp" ];
 

Notice the difference between BR and BRBR

Now turn all the text sizes down to 2 and try it again and notice the difference between BR and BRBR is more acceptable.

I do not know if there is away around this, I even tried ctrlSetFont  and ctrlSetFontHeight rather than in the text to see if it would account for linespacing but made no difference.

  • Like 1

Share this post


Link to post
Share on other sites

Adding more <br/> tags (maaany more :D) seems to work.

Don't really know what causes this, but its better than not having those linebreak(s).

It's a bit messy..

_ctrl = findDisplay 46 ctrlCreate ["RscStructuredText", 1001]; 
_ctrl ctrlSetPosition[ safeZoneX, safeZoneY, safeZoneWAbs, safeZoneH ]; 
_ctrl ctrlCommit 0; 
_ctrl ctrlSetStructuredText parseText format[ "<t size='8'>SMS von %1</t><br/><t size='8'>Nummer: %2</t><br/><br/><br/><br/><br/><br/><t color='#ff0000' size='8'>%3</t>", 1, 2, "brbr"];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×