Render UTF-8 names correctly in the Linux Insert menu #1389
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!1389
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/linux-menu-utf8"
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?
SDL2 provides device names in UTF-8. The Linux Insert menu's GDI shim measures and draws each byte separately, which distorts names such as
Micrófono. The menu also clips long labels at arbitrary byte offsets.The renderer fixture fails on
main(173 px instead of 156 px forMicrófono) and passes with this change. I also checked the marquee and ellipsis logic with accented and CJK text, ran the Linux updater fixture, and ran the audio input and menu hit tests on Windows.SDL2 audio device name contract
This landed in the v2.0.12 branch (merged there for testing; it reaches
mainwith that release), so closing. Thanks!Reopened: closing this was a mistake on my side. It was tested in the v2.0.12 branch, and it will be merged into main here, so it shows as merged. Sorry for the noise.
Looks good. The decoder in
text_codepointis correct: overlongs, surrogates, > U+10FFFF, and truncated or stray continuation bytes each give one U+FFFD per bad byte. Width and draw use the same decoder and the same kerning order, and the char-boundary helper keepsmic_keybehaving as before. The fixture runs against the bundled Inter fonts viafonts/*.ttfbeside the fake exe, so it does not depend on the system font, and it is registered inrun_all.pywith a Windows skip.Siblings: #1371 and #1405 only touch the face-loading code at the top of
gdi_posix.c(face_load,faces_load), and this PR only touches the text functions further down, so no textual conflict there. The only likely conflict is the adjacent entries intests/run_all.py. Logically they are independent too, because the test puts the bundled fonts first and #1371/#1405 only change the fallback path.Nits, none blocking:
marquee_posone byte per tick (see inline).CI: the Windows and builder jobs are green; the Linux Python checks and appimage were still pending when I looked.
Nit:
marquee_posstill ticks per byte, so inside a 2 to 4 byte character it snaps back to the samefromand the text holds still for 1 to 3 ticks before moving on. Harmless, but it makes the slide uneven on accented or CJK names. Steppingmarquee_posto the next char boundary in the tick code would even it out.