Skip to content

Text size, pinch to zoom, and the screen size the game is told - #55

Open
vadi2 wants to merge 5 commits into
mainfrom
ccr-14671218-tf96z6-u5-text-size
Open

vadi2 wants to merge 5 commits into
mainfrom
ccr-14671218-tf96z6-u5-text-size

Conversation

@vadi2

@vadi2 vadi2 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Brief overview of PR changes/additions

  • A Settings screen, opened from the game screen's title bar: a text size in sp, so the system font size scales it too, set with a slider or Smaller and Larger buttons.
  • A two-finger pinch on the console changes the same setting; the slider and buttons do the same without the gesture.
  • The console measures its font's cell and sends the columns and rows that fit with setScreenSize once they have held for 200 ms: after layout, rotation, the keyboard showing or hiding, and a text size change.
  • The console draws in the engine's consoleColors.
  • Why the engine could not send something (status sendError, as for a failed sendHidden) shows in a snackbar that TalkBack reads; the copy the engine replays after hello is not shown again.
  • data/Settings.kt: settings as Compose state over SharedPreferences; a new setting is one property and one row.

Motivation for adding to Mudlet

Players need to read the game at a size that suits their screen and eyes, and the game needs the real width and height to wrap its text for it.

Other info (issues closed, discussion etc)

🤖 Generated with Claude Code

https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J

…sion 4)

setScreenSize (columns, rows) replaces setViewWidthPx and is told to the
game as NAWS by libmudlet and the stand-in; the statuses columns and
viewWidthPx go. libmudlet reports consoleColors at load and on change,
and passes a script's announce() on as an announce message. The
self-test sends its measured console size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
A text size setting, on a new settings screen reached from the game
screen's title bar, sizes the console's text in sp, so the system font
scale scales it too; a two-finger pinch on the console changes the same
setting, and a slider with Smaller and Larger buttons is its accessible
equivalent. The console measures its font's cell and sends the columns
and rows that fit with setScreenSize once they have held for 200 ms,
after a layout, rotation, keyboard or size change. Its default colours
come from status consoleColors.

Why the engine could not send something (status sendError, as for a
failed sendHidden) now shows in a snackbar over the console's foot,
which TalkBack reads. The sendError the engine resends after hello is
not shown again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
…ck on black was

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
atTwiceTheSystemFontSizeNothingIsCutOff failed on API 28 and 36 with
"'Disconnected' overflows its space", though the connection bar's state
fits with room to spare. A String Text answers GetTextLayoutResult from
ParagraphLayoutCache.slowCreateTextLayoutResultOrNull, which lays the
text out again as a MultiParagraph at the last maximum width;
MultiParagraph.width is that maximum while the result's size is the
text's own width, so didOverflowWidth holds for every String Text
narrower than its space.

The check now takes didOverflowHeight, which still sees text squeezed
or cut short, and text too wide for its space (the relayout wraps it
into lines the real layout lacks), plus the widest line against the
text's width. A failure names the size, the widest line and the height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
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