Page 1 of 1

dsb_textformat seems wierd?

Posted: Fri Jan 05, 2024 8:17 am
by kaypy
The way this works seems wierd?

It looks like it has global effects, so if I ever use it for formatting my own text, then the main system UI goes wonky?

dsb_bitmap_textout is used all over the system UI, but dsb_textformat is only used in the default subrenderer, so everything in the system is relying on default values?

(current plan: back slowly away from the strange misbehaving system call and avoid making eye contact)

Re: dsb_textformat seems wierd?

Posted: Fri Jan 05, 2024 2:19 pm
by Gambit37
I can't check any of my notes right now, but from memory, dsb-textformat is only used to format the text on the message area below the viewport.

Re: dsb_textformat seems wierd?

Posted: Fri Jan 05, 2024 5:17 pm
by kaypy
Had another look around. What I had missed was that it only affects dsb_bitmap_textout with the MULTILINE flag set.

It still also breaks the main message area if you actually try to use it. But it wont affect most instances of dsb_bitmap_textout.

Oh, and if you try to use it to format the main message area on purpose, it will get reverted if the party ever looks at something with a long description field. (Or if you use it on a MULTILINE field as above)

Re: dsb_textformat seems wierd?

Posted: Fri Jan 05, 2024 8:08 pm
by Sophia
It isn't misbehaving; it is working as designed, but that design could use an update.

As you noted, dsb_textformat is used to set global formatting info for all further instances of MULTILINE text, and only those. The object renderer always reasserts its own settings, so you'll have to (and this was also by design) assert your own settings before you want to render something different.

Where you're running into trouble is that the console uses the line height given by the last instance of dsb_textformat as its own line height. This is perfectly fine if everything is using the FTL font and isn't doing anything too fancy, but it isn't very flexible.

For 0.82, I've added a property to gui_info.console (which didn't exist back when I wrote the text formatting code) to set the console's line height directly, so this weird side effect won't happen any more and you can use dsb_textformat without messing up the console.

Re: dsb_textformat seems wierd?

Posted: Sat Jan 06, 2024 1:21 am
by kaypy
Cool. Like I implied I wasn't planning on using it but it having that side effect was wierd and unsettling...