# windows: Slightly improve font rendering quality \(\#12015\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/c0259a448d6052222e8492538594e3d0e88733ae)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: c0259a448d6052222e8492538594e3d0e88733ae

Requested commit: c0259a448d6052222e8492538594e3d0e88733ae

Commit: c0259a448d6052222e8492538594e3d0e88733ae

Tree: 7329969986bc5fe79365c1aafae7881b5f30f589

Author: 张小白

Committer: GitHub

## Message

```
windows: Slightly improve font rendering quality (#12015)

Upper before this PR, lower after.

![Screenshot 2024-05-20
144852](https://github.com/zed-industries/zed/assets/14981363/88995482-3a98-41be-9c2c-6b781bef6ad2)

This PR manually applies a MSAA to the font atlas. Before this PR, the
font may seem aliased ( espeacially on low DPI monitors ), that's
because `DirectWrite` and `CoreText` ( on which currently `Zed` built
the whole text system ) uses different anti-aliasing strategy. The
different anti-aliasing approach used by `DirectWrite` and `CoreText`:

![Screenshot 2024-05-20
151114](https://github.com/zed-industries/zed/assets/14981363/21a2fc1e-48a2-4cff-a9d1-41602eff3658)

The upper is `VSCode` font rendering result, middle `macOS`, lower this
PR ( pic captured with same font face, same font size, same DPI, same
physical resolution, same editor theme, and same magnification rate ).

This PR brings a quality similiar to `CoreText`. What's more, from the
`VSCode` image, you can see how `DirectWrite` sub-pixel anti-aliasing is
performed on the edge of the glyph. Can we achieve the same rendering
quality? Currently, No. `Zed` use a grayscale image to render glyph, and
a sub-pixel anti-aliasing `DirectWrite` requires all RGB channels and
the foreground color of the rendering glyph, which `Zed` dose not
provide.

So, to achieve the quality of `VSCode` font rendering, the text system
of `Zed` needs much much more efforts to refactor the codes.


Release Notes:

- N/A
```

## Parents

- [a9e3d4ec4e9004a65ba00dde4159b40db44b1445](https://git.cafe/gitcafe/zed/commit/a9e3d4ec4e9004a65ba00dde4159b40db44b1445?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/c0259a448d6052222e8492538594e3d0e88733ae?format=markdown)
