Speedy2D icon indicating copy to clipboard operation
Speedy2D copied to clipboard

text squashing option

Open RiedleroD opened this issue 4 years ago • 2 comments

I'm not entirely sure this isn't already possible, but I haven't found any way to do this - Basically, in the TextOptions, setting an option for the text to be squashed when it goes out of the specified bounds. I need to set this for my (admittadly crude) UI backend, specifically the buttons.

I wrote this in a hurry, so sorry if I left something important out.

RiedleroD avatar Aug 26 '21 16:08 RiedleroD

Thanks for the suggestion -- I think you could do this in your own app by checking the bounds of the FormattedTextBlock, and repeatedly re-laying-out the text with smaller sizes until it fits within the bounds you want.

QuantumBadger avatar Aug 26 '21 23:08 QuantumBadger

aye, but what I'd want is for the text to render onto a texture which is large enough to hold it & it then getting scaled down to fit the bounds. I know this might introduce some scaling artifacts, but it's way more efficient.

Anyway, thanks for your suggestion. I will definitely try it out after implementing some more important features. I didn't really think about this variant of doing it, because that's also what I had to do in python, which had horrible performance caveats - but in rust, this should easily do for now.

RiedleroD avatar Aug 27 '21 06:08 RiedleroD