Skip to content

Conversation

@discobeast
Copy link

@discobeast discobeast commented Nov 3, 2025

Adjust text size based on the number of characters that can fit on the screen at a given font size with a string's length

Proposed Changes

I kept getting text overflow on my 160x128 screen so I made font sizes more dynamic to a display string length.

Types of Changes

New feature

Verification

You would probably need to run the script on a smaller display although you might still be able to see a difference on larger variants

Testing

I did test the changes on my esp32 s3 n16r8 using the settings menu

Linked Issues

User-Facing Change

"NONE"

Further Comments

Made this to stop my text from overflowing on my display
My display has sparkles on 2 sides of the screen but I am unsure if its related to my additions
This change may ruin some aesthetic due to the jarring difference between the text sizes
The problem this solves could also be solved with a scrolling text system (as used in "displayscrollingtext()") but I don't have the knowledge of c++ to do it.

Adjust text size based on the number of characters that can fit on the screen at a given font size with a string's length
@discobeast
Copy link
Author

Forgot to uncomment notes (Not good with markup)

@discobeast discobeast marked this pull request as draft November 3, 2025 22:49
@discobeast
Copy link
Author

discobeast commented Nov 3, 2025

Working on making it scale rather than use static numbers (although using static numbers as limits as I do not want to go through the effort of editing all the draw functions to fit dynamic fonts)
EDIT: apparently tft_espi cannot do scaled fonts without a refactor of all the display logic of bruce so this is the best I can do atm

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.

1 participant