Fix clipped machine name on DWIN boot screen - #260
Conversation
Up to standards ✅🟢 Issues
|
|
would |
|
I tested The string is 27 characters long. With With With the 272px display width, approximately:
I agree that a safety check could be useful. Checking the rendered text width against the available display width and desired margin would probably be more robust than checking only a fixed character count. I also tested the current PR with your three additional commits on actual hardware:
Build environment: Tested successfully:
Everything worked normally and I did not notice any regressions from the additional commits. One unrelated observation: the long machine name in the Main Menu header already uses almost the full screen width with practically no side margin. This behavior was already present before the additional PR commits, so it is not caused by these changes. |
|
IIRC, non-DWIN displays (DACAI, TJC) have some differences with font sizes. that said I wonder if there is a benefit using a ternary. I don't have these displays to test, just DWIN. I wonder if something like this would be a better fit: #if ANY(TJC_DISPLAY, DACAI_DISPLAY)
DWINUI::Draw_CenteredString(font8x16, Color_White, 220, F(MACHINE_NAME));
#else
DWINUI::Draw_CenteredString(font10x20, Color_White, 220, F(MACHINE_NAME));
#endif |
|
OK. On my Ender-3 S1 with DACAI rev 1.4, font8x16 is already tested and looks good with a comfortable margin on both sides. So using font8x16 for DACAI_DISPLAY / TJC_DISPLAY and font10x20 for DWIN seems like a reasonable approach. I can confirm the DACAI branch works correctly on actual hardware. Since you have a DWIN display, you can verify how the font10x20 branch looks there. |
Description
Fix the machine name / firmware identification text being shifted left and clipped on the boot screen.
The boot screen was drawing
MACHINE_NAMEusing the largefont12x24font. Long custom machine names could exceed the 272px display width, causing the centered text to start outside the visible screen area and become clipped.Changed the boot screen text font from
font12x24tofont8x16:DWINUI::Draw_CenteredString(font8x16, Color_White, 220, F(MACHINE_NAME));This allows longer
CUSTOM_MACHINE_NAMEstrings to fit correctly on the screen.Requirements
SHOW_BOOTSCREENenabledMACHINE_NAME/CUSTOM_MACHINE_NAMEto reproduce the clippingThe issue was reproduced on an Ender-3 S1 with a DACAI rev 1.4 display.
Benefits
CUSTOM_MACHINE_NAMEvalues to fit on a single lineConfigurations
Tested with:
SHOW_BOOTSCREENenabledF401RE 20260804 V1 MPC=PCTGTest result: the complete machine name is now displayed correctly and centered during startup.
Related Issues
No related issue.