cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
miguello
Level VI

How to do text justification in a TextBox with Markup?

I noticed that if text box has Markup enabled, then Text Justification property is ignored. 

I want the text to be right justified, and it just doesn't work. But as soon as I turn off markup - it aligns correctly.

Is it a bug?

Is there a way to justify marked up text using markup?

 

 

 

3 REPLIES 3
jthi
Super User

Re: How to do text justification in a TextBox with Markup?

This might give some idea what is going on. With markup the "extra" characters are still most likely there even if you don't see them and it looks like it won't align properly.

Names Default To Here(1);
win = New Window("Example", V List Box(Align(right),
	fontobj = text = Text Box("This is bold text. This is italic text. This is underlined text. This is bold, italic, underlined text.")));
text << Set Width(1400);
text << Justify Text("right");
Wait(2);
text << setText(
	"This is <b>bold</b> text. This is <i>italic</i> text. This is <u>underlined</u> text. This is <b><i><u>bold, italic, underlined</u></i></b> text."
);
wait(2);
text << markup;

 

-Jarmo
miguello
Level VI

Re: How to do text justification in a TextBox with Markup?

This was a perfect demonstration! Looks like a bug to me - or at least the behavior is totally unexpected. Any workaround for this?

jthi
Super User

Re: How to do text justification in a TextBox with Markup?

If the issue is as the previous example demonstrated, good solutions don't really come to mind. Maybe you could try playing around modifying the Width of textbox and adding SpacerBox before it. No idea how well this would work in the long run.

Names Default To Here(1);
win = New Window("Example", V List Box(Align(right),
	Spacer Box(Size(1400,0)),
	fontobj = text = Text Box("This is bold text. This is italic text. This is underlined text. This is bold, italic, underlined text.")));
text << Set Width(500);
text << Justify Text("right");
text << setText(
	"This is <b>bold</b> text. This is <i>italic</i> text. This is <u>underlined</u> text. This is <b><i><u>bold, italic, underlined</u></i></b> text."
);
wait(2);
text << markup;

 

-Jarmo