egui/crates
Emil Ernerfeldt dc79998044
Improve text rendering in light mode (#7290)
This changes how we convert glyph coverage to alpha (and ultimately a
color), but only in light mode.

This is a bit of a hack, because it doesn't fix dark-on-light text in
_dark mode_ (if you have any), but for the common case this PR is a huge
improvement.

You can also tweak this yourself now using
`Visuals::text_alpha_from_coverage` or from the UI (bottom of the
image):


![image](https://github.com/user-attachments/assets/350210d4-c0bb-44b6-84cc-47c2e9d4b9f0)



## Before / After

![widget_gallery_light_x1](https://github.com/user-attachments/assets/21f5a2a0-6b4e-4985-b17f-cd1c7cc01b46)
![widget_gallery_light_x1](https://github.com/user-attachments/assets/5dfec04a-c81c-43ef-8d86-fc48ef7958f1)


## Black text Before/after
If you think the text above looks too weak, it's only because of the
default text color. Here's how it looks like with perfectly `#000000`
black text:


![image](https://github.com/user-attachments/assets/56a4a4f3-c431-4991-b941-a566a4ae94ed)
![Screenshot 2025-07-02 at 13 59
30](https://github.com/user-attachments/assets/df5a91ad-0bb8-4a0f-81a2-50852e7556c1)
2025-07-02 14:58:37 +02:00
..
ecolor Use Rust edition 2024 (#7280) 2025-06-30 14:01:57 +02:00
eframe Extend .typos.toml to enforce american english (#7284) 2025-07-01 15:54:00 +02:00
egui Improve text rendering in light mode (#7290) 2025-07-02 14:58:37 +02:00
egui-wgpu Improve text rendering in light mode (#7290) 2025-07-02 14:58:37 +02:00
egui-winit Use Rust edition 2024 (#7280) 2025-06-30 14:01:57 +02:00
egui_demo_app Add `Visuals::weak_text_alpha` and `weak_text_color` (#7285) 2025-07-01 20:42:54 +02:00
egui_demo_lib Improve text rendering in light mode (#7290) 2025-07-02 14:58:37 +02:00
egui_extras Extend .typos.toml to enforce american english (#7284) 2025-07-01 15:54:00 +02:00
egui_glow Improve text rendering in light mode (#7290) 2025-07-02 14:58:37 +02:00
egui_kittest `egui_kittest`: Add `HarnessBuilder::theme` (#7289) 2025-07-02 12:00:22 +02:00
egui_plot Move `egui_plot` to its own repo (#4828) 2024-07-15 18:45:19 +02:00
egui_web Rename `master` branch to `main` (#7034) 2025-05-08 09:15:42 +02:00
emath Use Rust edition 2024 (#7280) 2025-06-30 14:01:57 +02:00
epaint Improve text rendering in light mode (#7290) 2025-07-02 14:58:37 +02:00
epaint_default_fonts Update `emoji-icon-font` with fix for fullwidth latin characters (#7067) 2025-05-21 13:22:23 +02:00