-
Notifications
You must be signed in to change notification settings - Fork 1.9k
experimental color emoji via opt-in egui_noto_emoji crate #7707
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
base: main
Are you sure you want to change the base?
Conversation
|
Preview is being built... Preview will be available at https://egui-pr-preview.github.io/pr/7707-alltheseas/color-emoji-tweaks View snapshot changes at kitdiff |
|
Hi! Awesome that you got it to work! Seems like numbers are always using emojis now though:
We should really keep the egui surface minimal though, egui should just have some api to register a image with a glyph, or maybe some kind of loader api to register them on demand. Then you could create a 3rd party crate for e.g. noto emoji that people could add to their project to get emoji support. Especially since egui will eventually get built in emoji support when we switch the font rendering implementation (#7694) |
|
Building on @lucasmerlin feedback, emojis are rendered via optional crate approach.
|
42568e4 to
6778db8
Compare



This builds off of @lucasmerlin's color emoji draft PR.
I could not figure out how to commit to the open draft PR, so I am opening this one. Apologies.
I added noto open emoji set for the demo app. It works locally for me (see screenshots below) after downloading Noto fonts, and doing some format conversions.
Multiple Noto color emojis show in egui demo & render upon input.
Screenshots:


Summary
loader that decodes a packed Noto emoji sheet, so 1 440 color
emojis ship with egui and stay vibrant across themes/atlas
resets.
regenerate the noto_{low,mid,high}.{atlas,bin} assets directly
from the upstream zip.
Testing
(Optional) Regenerate the atlas if you tweak the sprites:
ensure scripts/pack_noto_emoji.py exists (checkout the branch that
added it)
python3 scripts/pack_noto_emoji.py --zip noto-emoji-2.051.zip
mv crates/epaint/assets/emoji/noto_low.png crates/epaint/assets/
emoji/noto_low.atlas
mv crates/epaint/assets/emoji/noto_mid.png crates/epaint/assets/
emoji/noto_mid.atlas
mv crates/epaint/assets/emoji/noto_high.png crates/epaint/assets/
emoji/noto_high.atlas
(The script always writes .png; renaming keeps the files on the non-
LFS track the loader expects.)
Build & run:
cargo check
cargo run -p egui_demo_app --release --features "x11,wayland"
In the demo window open one of the text input boxes ( I used EasyMark Editor in top menu) and enter emojis like 😀
😍 🦀 to verify color rendering.
Snapshot tests (requires Git LFS assets):
cargo test -p egui_demo_app --test test_demo_app
Expect differences; once reviewed, re-run with UPDATE_SNAPSHOTS=1
to refresh.