bevyengine / bevyengine/bevy

Misleading namings in `bevy_text`

Open
#19,467 0 comments 0 reactions 0 assignees View on GitHub
A-Text C-Code-Quality S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Problem

The names of some of the components in `bevy_text` are confusing and inconsistent:

* `TextLayoutInfo`
Contains the final computed text layout. The `-Info` suffix is redundant and potentially confusing.

* `TextLayout`
Holds the settings for text justification and line breaking. Not the layout.

* `ComputedTextBlock`
This holds the cosmic-text buffer. The name suggests that it contains the final result of a text relayout, but the buffer can be out-of-date until it is updated during the text schedule.

## Suggestions

Renamings:
* `TextLayoutInfo` -> `ComputedTextLayout`
* `ComputedTextBlock` -> `TextBuffer`

Remove the `TextLayout` component.

`JustifyText` and `LineBreak` become components `Require`d by `Text` and `Text2d`.

Contributor guide

Open the contributing guide

Research direction

Start in the `bevy_text` module and trace references to `TextLayoutInfo`, `TextLayout`, `ComputedTextBlock`, `JustifyText`, and `LineBreak`. The work is complete when the proposed renamings and component removal are applied consistently, with `JustifyText` and `LineBreak` required by `Text` and `Text2d`.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.