Make the font atlas use a color image#7298
Merged
emilk merged 1 commit intoemilk:mainfrom Jul 4, 2025
Merged
Conversation
|
Preview available at https://egui-pr-preview.github.io/pr/7298-color-font-atlas |
Draft
jonatino
added a commit
to VoltaSoftware/egui-miniquad
that referenced
this pull request
Oct 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Splitting this out from the Parley work as requested. This removes
FontImageand makes the font atlas use aColorImage. It converts alpha to coverage at glyph-drawing time, not at delta-upload time.This doesn't do much now, but will allow for color emoji rendering once we start using Parley.
I've changed things around so that we pass in
text_alpha_to_coverageto theFontsthe same way we do withpixels_per_pointandmax_texture_side, reusing the existing code to check if the setting differs and recreating the font atlas if so. I'm not quite sure why this wasn't done in the first place.I've left
ImageDataas an enum for now, in case we want to add support for more texture pixel formats in the future (which I personally think would be worthwhile). If you'd like, I can just remove that enum entirely.