Files
oak-gpui/crates
Kirill Bulatovandlocalcc e72021a26b Implement perceptual gamma / contrast correction for Linux font rendering (#38862)
Part of https://github.com/zed-industries/zed/issues/7992
Port of https://github.com/zed-industries/zed/pull/37167 to Linux

When using Blade rendering (Linux platforms and self-compiled builds
with the Blade renderer enabled), Zed reads `ZED_FONTS_GAMMA` and
`ZED_FONTS_GRAYSCALE_ENHANCED_CONTRAST` environment variables for the
values to use for font rendering.

`ZED_FONTS_GAMMA` corresponds to
[getgamma](https://learn.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwriterenderingparams-getgamma)
values.
Allowed range [1.0, 2.2], other values are clipped.
Default: 1.8

`ZED_FONTS_GRAYSCALE_ENHANCED_CONTRAST` corresponds to
[getgrayscaleenhancedcontrast](https://learn.microsoft.com/en-us/windows/win32/api/dwrite_1/nf-dwrite_1-idwriterenderingparams1-getgrayscaleenhancedcontrast)
values.
Allowed range: [0.0, ..), other values are clipped.
Default: 1.0

Screenshots (left is Nightly, right is the new code):

* Non-lodpi display

With the defaults:

<img width="2560" height="1600" alt="image"
src="https://github.com/user-attachments/assets/987168b4-3f5f-45a0-a740-9c0e49efbb9c"
/>


With `env ZED_FONTS_GRAYSCALE_ENHANCED_CONTRAST=7777`: 

<img width="2560" height="1600" alt="image"
src="https://github.com/user-attachments/assets/893bc2c7-9db4-4874-8ef6-3425d079db63"
/>


Lodpi, default settings:
<img width="3830" height="2160" alt="image"
src="https://github.com/user-attachments/assets/ec009e00-69b3-4c01-a18c-8286e2015e74"
/>

Lodpi, font size 7:
<img width="3830" height="2160" alt="image"
src="https://github.com/user-attachments/assets/f33e3df6-971b-4e18-b425-53d3404b19be"
/>


Release Notes:

- Implement perceptual gamma / contrast correction for Linux font
rendering

---------

Co-authored-by: localcc <work@localcc.cc>
2025-09-25 16:02:27 +03:00
..
2025-09-18 16:47:23 +00:00
2025-08-13 13:25:52 -06:00
2025-09-08 21:53:17 -06:00
2025-09-22 14:36:10 -07:00
2025-09-03 22:10:14 +00:00
2025-09-18 16:47:23 +00:00
2025-09-17 10:47:09 +00:00
2025-09-24 23:11:40 +00:00
2025-09-18 16:47:23 +00:00
2025-07-17 14:25:55 +00:00
2025-07-08 14:34:57 +00:00
2025-09-24 02:19:52 -06:00
2025-09-18 16:47:23 +00:00
2025-09-18 16:47:23 +00:00
2025-09-08 21:53:17 -06:00
2025-09-23 11:12:39 +00:00
2025-09-22 14:36:10 -07:00
2025-09-18 16:47:23 +00:00
2025-09-18 16:47:23 +00:00
2025-09-24 16:03:08 +00:00
2025-09-18 16:47:23 +00:00