-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
[BUG] Extui font-scaling fails on 320x240 #18076
Comments
@RudolphRiedel: It would be hackish, but we could modify the language files to shorten those strings when the higher resolution was selected. Probably not worth the effort, however.
There's probably a bug in the font scaling code, which is here Maybe it is picking the wrong font if it can't find one that fits.
Yeah, I imagine 320x240 is not really feasible for the Marlin UI. I did intended the FTDI code to be reusable in other projects, so if you want to add support for other 320x240 displays, go ahead. I don't think it will be wasted effort necessarily, just maybe not useful in Marlin, per se. |
I had a quick look at this before I reported this but could not really figure out what is wrong there as I am not even clear on what exactly is fed into this function in the end.
Is it possible that this even was my idea back when I contacted you first? As I have my own code library for EVE displays that already supports a whole lot more displays I have no need for this outside of Marlin. So only adding 4.3", 5.0" and perhaps 7.0" displays might be the better option then. |
It takes three arguments, w and h, which are the width and height of the box for the text in pixels and the text string itself. The code then loops through various font sizes, measures the text at that font size and then on line 329 checks to see whether the text fits, breaking out of the loop if it does:
Do you see the problem? The last font size it checks is 26. If it does not fit, it decrements by one and breaks out of the loop. Thus, it ends up using font size 25, which in the FTDI is actually a very big font. So the fix is to change the line that reads:
To:
Sure, you don't have to, if you don't want to.
That makes sense to me. |
Yes, but to figure out with what values exactly this is called is a bit tricky.
Missed that, thanks.
I tried this and it works but the strings are still a little too big. So I tried using the original line and added this after the loop: While this works it is not really better, the different font makes it ugly and not better to read. I see to submit your fix then but right now I better not make a pull request for my currently experimental branch. :-) My two adapter boards are getting closer to beeing released, I need another revision for both of these though. |
@RudolphRiedel still an issue? |
The pull request does apply the fix Marcio mentioned here. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
@marciot
I am playing with adding a bunch of new displays.
The font-scaling does fail with 320x240 in multiple places:
"Increment"
"Run Speed"
"Sensorless Homing"
"Extraction" and the Accleration values on the "Acceleration" screen.
The temperatures in the "Change Filament" screen.
And it is not that these are printing a little too big, these are printed way larger than anything else.
Disabling TOUCH_UI_FIT_TEXT helps but the fonts in fonts.h seem to be selected a bit large.
For font_tiny and font_xsmall I went to font number 20 but while this works it is not really viable anymore.
Overall 320x240 do not seem to be a viable option and maybe the minimum supported should be 480x272?
The text was updated successfully, but these errors were encountered: