Skip to content

Text underline#21559

Merged
alice-i-cecile merged 30 commits intobevyengine:mainfrom
ickshonpe:underline
Oct 22, 2025
Merged

Text underline#21559
alice-i-cecile merged 30 commits intobevyengine:mainfrom
ickshonpe:underline

Conversation

@ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Oct 15, 2025

Objective

Text Underline

Solution

New Underline marker component, add to text entities to draw an underline.
This PR is based on #21555, that should probably be reviewed and merged first.

@ickshonpe ickshonpe changed the title Text nderline support Text underline support Oct 15, 2025
@ickshonpe ickshonpe changed the title Text underline support Text underline Oct 15, 2025
@ickshonpe ickshonpe added C-Feature A new feature, making something new possible A-Text Rendering and layout for characters D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 15, 2025
@alice-i-cecile alice-i-cecile added the M-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
@ickshonpe ickshonpe mentioned this pull request Oct 16, 2025
github-merge-queue bot pushed a commit that referenced this pull request Oct 21, 2025
# Objective

Add minimal strikethrough support for text.

## Solution

* Insert the new `Strikethrough` component on any `Text`, `Text2d`, or
`TextSpan` entity and its text will be drawn with strikethrough.
* The strikethrough 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 strikethrough 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 strikethrough
```

## Showcase

<img width="1422" height="924" alt="strikeout"
src="https://github.com/user-attachments/assets/c8ea2578-e40c-4c46-ae0d-df9e3f261f3a"
/>
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 22, 2025
@alice-i-cecile
Copy link
Member

@ickshonpe lemme know when merge conflicts are fixed :)

@ickshonpe
Copy link
Contributor Author

@ickshonpe lemme know when merge conflicts are fixed :)

Should be ready to go, assuming it passes CI.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 22, 2025
Merged via the queue into bevyengine:main with commit d5a16b7 Oct 22, 2025
36 checks passed
mate-h pushed a commit to mate-h/bevy that referenced this pull request Oct 22, 2025
# Objective

Add minimal strikethrough support for text.

## Solution

* Insert the new `Strikethrough` component on any `Text`, `Text2d`, or
`TextSpan` entity and its text will be drawn with strikethrough.
* The strikethrough 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 strikethrough 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: bevyengine#21559.

## Testing

```
cargo run --example strikethrough
```

## Showcase

<img width="1422" height="924" alt="strikeout"
src="https://github.com/user-attachments/assets/c8ea2578-e40c-4c46-ae0d-df9e3f261f3a"
/>
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-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes M-Release-Note Work that should be called out in the blog due to impact S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants