fix(prompts): find the prompts' font on native Windows, kept from its stream's start #2583
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2583
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/prompts-font-at-stream-start"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On native Windows the live button prompts (#2366) never find the font, so a change of face or of controls waits for a restart (seen in #2435's testing). The game keeps the font there from its stream's start with the stream's size the file's, and
hos_prompts_glyphlooked 8 bytes in, for a header that isn't there.What it does
hos_prompts_glyph(host/prompts.c) takes a stream of the served font's size and looks for the font's head where it looked before (behind the 8-byte header when the size is the file's), then at the stream's start. Whichever holds the head isfont.at. A face whose bytes aren't readable yet is looked at again, as before; one with neither head is another font, as before.Why
A diagnostic build on native Windows 11 (RTX 5060 Ti, the v131072 game) logged each face FreeType draws from, its stream's base and size:
The size is the served file's (55088), so the code read from
base + 8. The bytes there,00 03 00 30, are the OpenType header's ownentrySelector(3) andrangeShift(48): the font starts atbase, with no header in front. #2435's description and comment guessed a size mismatch; the size matches and the start is the difference.Testing
In game, native Windows 11, RTX 5060 Ti, keyboard and mouse, driven with the control bridge (headless), a save in the Fire Temple:
prompts: the font at ...prompts: the font at 0x7fd37800e8: the icons in texts follow at oncenow the xbox icons in texts; the pause menu reopened shows LB/RB, A, Bnow the keyboard icons in texts; Q/R, E, Shift againTests:
test_prompts_live,test_prompt_font_bind,test_menu_hookspass. The fix was tested on top of #2435's branch, the same function as on main.🤖 Generated with Claude Code
github-sync referenced this pull request2026-11-12 06:22:54 +00:00