Skip to content

Fix clipped machine name on DWIN boot screen - #260

Open
oldgamer6753 wants to merge 5 commits into
classicrocker883:2026-Augustfrom
oldgamer6753:fix/clipped_machine_name_on_DWIN_boot_screen
Open

Fix clipped machine name on DWIN boot screen#260
oldgamer6753 wants to merge 5 commits into
classicrocker883:2026-Augustfrom
oldgamer6753:fix/clipped_machine_name_on_DWIN_boot_screen

Conversation

@oldgamer6753

Copy link
Copy Markdown

Description

Fix the machine name / firmware identification text being shifted left and clipped on the boot screen.

The boot screen was drawing MACHINE_NAME using the large font12x24 font. 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 font12x24 to font8x16:

DWINUI::Draw_CenteredString(font8x16, Color_White, 220, F(MACHINE_NAME));

This allows longer CUSTOM_MACHINE_NAME strings to fit correctly on the screen.

Requirements

  • DWIN ProUI display
  • SHOW_BOOTSCREEN enabled
  • A sufficiently long MACHINE_NAME / CUSTOM_MACHINE_NAME to reproduce the clipping

The issue was reproduced on an Ender-3 S1 with a DACAI rev 1.4 display.

Benefits

  • Prevents long machine names from being clipped on the left side of the boot screen
  • Keeps the boot text properly centered
  • Allows longer CUSTOM_MACHINE_NAME values to fit on a single line
  • Does not affect the boot progress bar or other ProUI screens
  • Minimal change limited to the boot screen text font

Configurations

Tested with:

  • Ender-3 S1
  • STM32F401RE mainboard
  • DACAI rev 1.4 display
  • DWIN LCD ProUI
  • SHOW_BOOTSCREEN enabled
  • Long custom machine name:
    F401RE 20260804 V1 MPC=PCTG

Test result: the complete machine name is now displayed correctly and centered during startup.

Related Issues

No related issue.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@classicrocker883

Copy link
Copy Markdown
Owner

would font10x20 still be too big? and what would you think is the character limit? we could put in a safety sanity check

@oldgamer6753

Copy link
Copy Markdown
Author

I tested font10x20 on my Ender-3 S1 with a DACAI rev 1.4 display using:
CUSTOM_MACHINE_NAME "F401RE 20260715 V1 MPC=PCTG"

The string is 27 characters long. With font10x20 it fits without clipping, but there is practically no margin left on either side of the display.

With font8x16 there is a comfortable margin on both sides, so I would prefer keeping font8x16 for the boot screen.

With the 272px display width, approximately:

  • font10x20: 27 characters is essentially the maximum without a useful margin. For about a 2-character margin on each side, I would limit it to about 23 characters.
  • font8x16: 27 characters uses 216px and leaves a good margin. For about a 2-character margin on each side, a safe limit would be about 29 characters.

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:

  • Replace CUSTOM_MACHINE_NAME with MACHINE_NAME
  • Optimize string drawing with F()
  • Use F() - missed

Build environment: STM32F401RE_creality
Hardware: Ender-3 S1, STM32F401RE, DACAI rev 1.4, DWIN_LCD_PROUI + DACAI_DISPLAY.

Tested successfully:

  • Boot screen / CUSTOM_MACHINE_NAME
  • Main Menu
  • Info Menu
  • Startup firmware information screens
  • Tramming Wizard
  • Status messages
  • SD print start and G-code / print header

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.

@classicrocker883

classicrocker883 commented Aug 18, 2026

Copy link
Copy Markdown
Owner

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:
line ~1346

#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

@oldgamer6753

Copy link
Copy Markdown
Author

OK.
That makes sense to me.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants