Skip to content

Store colors in TextLayoutInfo and extraction buffers per per glyph/slice #18849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ickshonpe opened this issue Apr 15, 2025 · 0 comments
Open
Labels
A-Rendering Drawing game state to the screen A-Text Rendering and layout for characters C-Code-Quality A section of code that is hard to understand or change C-Performance A change motivated by improving speed, memory usage or compile times

Comments

@ickshonpe
Copy link
Contributor

ickshonpe commented Apr 15, 2025

What problem does this solve or what need does it fill?

With per section color storage:

  1. Text extraction has to query for the TextColor components seperately, adding extra complexity to the extraction function and degrading performance.
  2. A new extracted item has to be queued per color change. This will be very expensive if you have a lot of different coloured glyphs.

What solution would you like?

Store colors in TextLayoutInfo and the extraction buffers per per glyph/slice

Alternatives

We could store the colors in a separate list of (Color, Range<usize>) or something.
The synchronisation would add complexity though and for games it's common to have large numbers of small text labels where per glpyh storage should be more efficient.

@ickshonpe ickshonpe added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times C-Code-Quality A section of code that is hard to understand or change A-Text Rendering and layout for characters and removed S-Needs-Triage This issue needs to be labelled C-Feature A new feature, making something new possible labels Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-Text Rendering and layout for characters C-Code-Quality A section of code that is hard to understand or change C-Performance A change motivated by improving speed, memory usage or compile times
Projects
None yet
Development

No branches or pull requests

1 participant