Implement a tile based deferred text renderer for perfect glyph overlaps #22870

Open
opened 2026-01-31 08:25:45 +00:00 by claunia · 0 comments
Owner

Originally created by @lhecker on GitHub (Feb 8, 2025).

Before:

before

After:

after

To people who work on video games this is probably a piece of cake. To anyone else, I hope this suffices:

explanation

The key here is that we accumulate the ClearType weights separately from the foreground colors via max() and only then blend it with the foreground color into the resulting image. The max() ensures that no emboldening occurs on overlaps, unlike with regular alpha blending (two semi-transparent colors result in one slightly opaquer).

Originally created by @lhecker on GitHub (Feb 8, 2025). Before: ![before](https://github.com/user-attachments/assets/eb8dabdc-3f49-401b-8c67-ebc2e0569065) After: ![after](https://github.com/user-attachments/assets/4d16eddc-3b1a-4a44-aae1-e24159c0ed11) To people who work on video games this is probably a piece of cake. To anyone else, I hope this suffices: ![explanation](https://github.com/user-attachments/assets/26e6d480-0a59-47e4-87ac-da630a2f5f8c) The key here is that we accumulate the ClearType weights _separately_ from the foreground colors via `max()` and only then blend it with the foreground color into the resulting image. The `max()` ensures that no emboldening occurs on overlaps, unlike with regular alpha blending (two semi-transparent colors result in one slightly opaquer).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22870