Skip to content

Improve text sharpness#5838

Merged
emilk merged 2 commits intomasterfrom
emilk/tweak-font-sharpness
Mar 21, 2025
Merged

Improve text sharpness#5838
emilk merged 2 commits intomasterfrom
emilk/tweak-font-sharpness

Conversation

@emilk
Copy link
Owner

@emilk emilk commented Mar 21, 2025

This improves the sharpness of text slightly, thanks to https://hikogui.org/2022/10/24/the-trouble-with-anti-aliasing.html by @hikogui (🙏 ).

The difference is very small, but in dark mode (bright text on dark background) text is sometimes significantly sharper, and also slightly brighter.

The difference in light mode (dark text on light background) is much smaller (barely perceptable).

To compare the before/after I suggest you open both in new tabs, then quickly change between them.

Low-DPI

Before

Code Editor old

After

Code Editor

Before

old-white

After

new-white

High-DPI

The difference is starkest on low-DPI screens (like the above screenshots). On high-DPI screens, the difference is much smaller

Before

widget_gallery old

After

widget_gallery

@emilk emilk added visuals Renderings / graphics releated egui epaint style visuals and theming labels Mar 21, 2025
@emilk emilk requested a review from lucasmerlin as a code owner March 21, 2025 09:59
@github-actions
Copy link

Preview available at https://egui-pr-preview.github.io/pr/5838-emilktweak-font-sharpness
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@emilk emilk merged commit 2058dcb into master Mar 21, 2025
50 checks passed
@emilk emilk deleted the emilk/tweak-font-sharpness branch March 21, 2025 11:56
darkwater pushed a commit to darkwater/egui that referenced this pull request Aug 24, 2025
This improves the sharpness of text slightly, thanks to
<https://hikogui.org/2022/10/24/the-trouble-with-anti-aliasing.html> by
@hikogui (🙏 ).

The difference is very small, but in dark mode (bright text on dark
background) text is sometimes significantly sharper, and also slightly
brighter.

The difference in light mode (dark text on light background) is much
smaller (barely perceptable).

To compare the before/after I suggest you open both in new tabs, then
quickly change between them.

### Low-DPI
#### Before
![Code Editor
old](https://github.com/user-attachments/assets/e10a3cad-932f-48cd-b7d6-5bfe70954c5e)

#### After
![Code
Editor](https://github.com/user-attachments/assets/2e7383fe-8023-4425-91c8-93df3c22c0fe)

#### Before

![old-white](https://github.com/user-attachments/assets/51c41c59-e897-4831-857a-f3ffe17ce7d4)

#### After

![new-white](https://github.com/user-attachments/assets/4ac6f951-8c57-4bcc-a5d5-788cf52ea7d8)

### High-DPI
The difference is starkest on low-DPI screens (like the above
screenshots). On high-DPI screens, the difference is much smaller

#### Before
![widget_gallery
old](https://github.com/user-attachments/assets/f2149a30-aef8-4383-b48c-73d33a03ca02)

#### After

![widget_gallery](https://github.com/user-attachments/assets/c9ceb8be-8a32-490c-9364-2c6562b741f6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

egui epaint style visuals and theming visuals Renderings / graphics releated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant