-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoscale doesn't handle vertical text overflow #305
Comments
Is there a way to detect when this happens? I can manually override the font for specific cases but with a large number of cards I can't visually go through all of them. |
In my sample code given above, note how I first set the dimensions of Then, I invisibly render the text ( Lastly, I check that the rendered extent actually fits inside the space I set aside for it: |
I vendorized and tried to patch squib: bullno1/LCI_Translation@509dec5#diff-0981dcc049afcbab0b08c40bec18f856affe3fae5b471e7d8b578c19eaaaed4e It seems to work for my case. The idea is to just measure the box size during dummy draw. |
Quote from @nickolasreynolds regarding our autoscaling text feature.
...the native one ignores vertical overflow, which can result in cutting off the bottom of long strings or strings with carriage returns. Also, I needed to autoscale some lines with wordwrap disabled (like the name, type, and copyright), which I couldn't get the native scaler to do. Here's some code showing what I came up with, and also showing the sort of relative / percentage-based positioning system I implemented. (Also please feel free to use any of my code or ideas now and in the future, under whatever license Squib is published, if you think they are useful. I'm simply showing you the "copyright" section of the layout I'm making because it's clean, and I'm not doing anything too complicated or fancy there, but it still has all the functionality I wanted to show you.)
I know you can't see the exact implementation of my Box class and the can_fit method (but I'll be happy to send over all the code for my current project once it's in a mostly working and readable state, stay tuned!), but hopefully that all makes sense! It would be cool if there were a more convenient / built-in way to accomplish things like what I did above. I don't really have any idea what that would look like on your end, I'm just throwing it out there.
The text was updated successfully, but these errors were encountered: