Speedy2D
Speedy2D copied to clipboard
text squashing option
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.
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.
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.