Skip to content

Kill feed: names no longer cut off at the right edge with a bigger scale or your own font (part of #728) - #998

Merged
ccoventry merged 3 commits into
devfrom
fix/killfeed-right-edge-728
Oct 24, 2026
Merged

ccoventry merged 3 commits into
devfrom
fix/killfeed-right-edge-728

Conversation

@ccoventry

@ccoventry ccoventry commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Release note: Fixed: with a bigger kill feed or your own kill-feed font, the victim's name no longer runs into the right edge of the screen.

Part of #728

What was wrong

CHudDeathNotice::Draw anchors each line at ScreenWidth - icon - victim width, so the victim's measured width ends exactly on the screen's edge (the game does this too). The measure is the sum of glyph advances, so a big face's last glyph (its overhang) and a drop shadow land past the edge. At the game's own 16 px face that's a pixel or two. At scale 2+ on 2560x1440, with the engine font or font Bahnschrift SemiBold 32 shadow, the last letter was visibly cut ("motiv", "G A U L", "element").

A diag build logged every line's numbers on POST and PRE at 2560x1440 (scale 2, engine font). The anchor, the icon advance (scaled rect) and the victim's draw all agree: every victim ends at exactly x = 2560. Nothing uses the unscaled icon width. The user's "rifle lines overflow most" was the same edge cut on each line. It isn't Anniversary-only, and #860/#890 don't change it: #890's trim only swaps the rect inside the SPR_DrawHoles hook, never the rects the layout reads.

Fix

The victim's width call (the first call of each line) now goes to its own redirect, victim_len. While a scale or a font is in force, it adds a right margin: 1/160 of the screen width (16 px at 2560, 12 at 1920), or a quarter of the text height when that is more. The whole line moves left by that much. At scale 1 with no font, the layout is still exactly the game's.

Decisions

  • The margin is on only while scale or font is in force, so the stock layout stays byte-for-byte the game's.
  • Margin = max(width/160, text height/4). It covers the overhang plus the shadow of the faces tried, and grows with a huge face.

Test done

Test DLL: local\test-killfeed-edge\. game_probe, Brain account. Real demo kills plus fake lines (garand, grenade, mp44, kar). Scales 1/2/2.5/3, each with the engine font and with font Bahnschrift SemiBold 32 shadow (the WSOD25 settings):

  • POST 2560x1440, wsod25_grp1_h1_m00cat (dod_addon, -addons): every victim name is clear of the edge at scales 2/2.5/3 with both fonts. Scale 1 + engine font is unchanged (stock, flush).
  • POST 1920x1080, same demo: same result.
  • PRE 2560x1440, ktps8w1-m00cat_soul_lenn_h2: same result. Two grabs caught the scoreboard or an empty feed (demo timing), not a layout issue.
  • PRE 1920x1080, same demo: same result.
  • cargo test -p goldsrc-hooks: 768 passed, including a new right_margin test.
  • clippy -D warnings (toolchain 1.98.1) is clean for i686 and host; cargo fmt --check passes.

#1000 (outline and backgrounds) is stacked on this PR.
Screenshots and contact sheets: main checkout local\review-images\killfeed-edge\ (edge-*-sheet.png).

🤖 Generated with Claude Code

…or font

With `ds_hud_deathmsg scale` or `font` in force, the victim's width call
now reserves a right margin (1/160 of the screen's width, or a quarter of
the text's height when that is more). Draw anchors each line at
ScreenWidth - icon - victim width, so the victim's measured width sat flush
against the edge and a big last glyph or a drop shadow was cut. At scale 1
with no font the layout stays the game's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ccoventry
ccoventry merged commit 9b70c0c into dev Oct 24, 2026
5 checks passed
@ccoventry
ccoventry deleted the fix/killfeed-right-edge-728 branch October 24, 2026 09:42
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