Skip to content

Conversation

ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Oct 15, 2025

Objective

Add minimal strikeout support for text.

Solution

  • Insert the new Strikeout component on any Text, Text2d, or TextSpan entity and its text will be drawn with strikeout.
  • The strikeout geometry is stored in TextLayoutInfo in the vec with the section bounding rects.
  • Rendering is trivial, identical to drawing text background colours except it's a narrower rect drawn in front instead of behind.
  • Text shadows also have strikeout if the text does.

This implementation can easily be expanded to support underline, I've already made a follow up PR that does this here: #21559.

Testing

cargo run --example strikeout

Showcase

strikeout

@ickshonpe ickshonpe added C-Feature A new feature, making something new possible A-Text Rendering and layout for characters D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-Rendering Drawing game state to the screen labels Oct 15, 2025
@ickshonpe ickshonpe removed the A-Rendering Drawing game state to the screen label Oct 15, 2025
@ickshonpe ickshonpe removed this from Rendering Oct 15, 2025
@ickshonpe ickshonpe changed the title Text strikeout support Text strikeout Oct 15, 2025
@ickshonpe ickshonpe mentioned this pull request Oct 15, 2025
@alice-i-cecile alice-i-cecile added the M-Needs-Release-Note Work that should be called out in the blog due to impact label Oct 15, 2025
@alice-i-cecile alice-i-cecile added this to the 0.18 milestone Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Text Rendering and layout for characters C-Feature A new feature, making something new possible D-Straightforward Simple bug fixes and API improvements, docs, test and examples M-Needs-Release-Note Work that should be called out in the blog due to impact S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants