Settings menu: a LANGUAGE line, Chinese drawn with the host's font #2445
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2445
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2445"
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?
@suluojin-ui on GitHub · 2026-11-29 13:06 UTC · original
suluojin-ui:menu-zh→main· +673 −21 · 5 files · 1 commits · closed without mergingA Chinese menu for the F1 settings box, without growing the glyph table.
What it adds
VICTORY_MENU_LANG=zh|en). Unset means Chinese (the fork's audience); the choice is saved invictory-settings.txtlike every other item and applied at once.crates/victory-gpu/src/host/gdi_text.rs: paints the box with a face the host already has — Microsoft YaHei UI, then Microsoft YaHei, then SimHei — through GDI. Chinese, its punctuation and characters the 16x16 table has no picture for all show; letters are antialiased and as tall as the box's cells. Mixing is done forB8G8R8A8,R10G10B10A2andR16G16B16A16_FLOAT.crates/victory-gpu/src/host/menu_zh.rs: the menu's sentences in Chinese — setting names, values, actions, about lines, notes, the key-binding page. A line it does not list stays English.SCALE_HEIGHT = 450(was the hard-coded 540): the box and its letters are one step larger on 1440p (25-pixel letters, 1104x791 box). Trivial to drop back if you prefer the old size.Why a host face
The table stays as it is: it is still the fallback. Nothing in
font.rsorcjk_table.rschanges. A host face covers any Chinese without adding tens of thousands of glyphs, and the table's letters are drawn per pixel anyway, so one path does not exclude the other.VICTORY_MENU_TEXT=0forces the table; an unknown frame format, an empty font list or a failingTextOutWfalls back to it per frame.What does not change
Only the drawing of the box and the wording. Saving, key bindings, save import/export, restarts and the frame-rate line's own path are untouched; the item is appended at the end of
ITEMS, so no existing line moves.Testing
cargo test -p victory-gpu --release host::menu— 15 tests, including a newthe_text_layer_paints_the_boxthat paints a 368x269 and a 736x538 box through GDI and asserts letters appear and grow with the scale. Run on Windows 11 with an RTX 3070 Ti; also run in the real game (F1 opens, the list scrolls, a change saves at once).Limits
829188e9; lines added later show in English until translated.Pull request closed