Skip to content

gpui: Fix macOS font render clipped bug again#47001

Merged
Veykril merged 8 commits intozed-industries:mainfrom
huacnlee:fix-font-render
Mar 19, 2026
Merged

gpui: Fix macOS font render clipped bug again#47001
Veykril merged 8 commits intozed-industries:mainfrom
huacnlee:fix-font-render

Conversation

@huacnlee
Copy link
Copy Markdown
Contributor

@huacnlee huacnlee commented Jan 16, 2026

Continue #45957 #46906 to fix font render issue again.

Release Notes:

  • Fixed macOS font render clipped bug when use .SystemUIFont.
.SystemUIFont .ZedMono
image image
cargo run -p gpui --example text

Test in Zed with .ZedMono font:

image

With .ZedSans:

image

Monaco:

image

Menlo:

image

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 16, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Jan 16, 2026
@maxdeviant maxdeviant changed the title gpui: Fix macOS font render clipped bug again. gpui: Fix macOS font render clipped bug again Jan 16, 2026
@huacnlee huacnlee marked this pull request as draft January 16, 2026 16:26
@huacnlee huacnlee marked this pull request as ready for review January 16, 2026 17:32
@huacnlee
Copy link
Copy Markdown
Contributor Author

huacnlee commented Jan 16, 2026

I've tried many methods without success, so it seems the problem might be internal to FontKit itself.

Maybe servo/font-kit#194 servo/font-kit#253

The current fix, increasing the font size by 1-5 pixels based on a 3% font size, looks a bit odd, but it does solve the issue.

And the maximum 5px increase has minimal negative impact on font rendering.

Copy link
Copy Markdown
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge this after preview cuts tomorrow to give this some time to bake, thanks!

@Veykril Veykril assigned Veykril and unassigned reflectronic Mar 17, 2026
@Veykril
Copy link
Copy Markdown
Member

Veykril commented Mar 19, 2026

if you could rebase this then I'm happy to merge

@huacnlee
Copy link
Copy Markdown
Contributor Author

huacnlee commented Mar 19, 2026

@Veykril Done

cargo run -p gpui --example text

And I have to enable font-kit feature to gpui dev-dependencies to let example's can render font.

image image image image

@Veykril Veykril enabled auto-merge (squash) March 19, 2026 09:45
@Veykril Veykril merged commit 5b104de into zed-industries:main Mar 19, 2026
30 checks passed
AmaanBilwar pushed a commit to AmaanBilwar/zed that referenced this pull request Mar 20, 2026
Continue zed-industries#45957 zed-industries#46906 to fix font render issue again.

Release Notes:

- Fixed macOS font render clipped bug when use `.SystemUIFont`.

| .SystemUIFont | .ZedMono |
| --- | --- |
| <img width="1034" height="978" alt="image"
src="https://github.com/user-attachments/assets/96b815a1-9484-4a38-8391-a4af3db51a36"
/> | <img width="1034" height="978" alt="image"
src="https://github.com/user-attachments/assets/1aaece42-9acd-47b0-a0a0-3cb425f40301"
/> |

```bash
cargo run -p gpui --example text
```

Test in Zed with `.ZedMono` font:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/1e44d186-cee5-4f54-910a-4c4602ca010e"
/>

With `.ZedSans`:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/1e502f3e-794c-4082-9faf-5a920adc1214"
/>

`Monaco`:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/906a3fd2-715a-4f53-b6fe-4614f4c6edab"
/>

`Menlo`:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/a8f8c302-2083-477c-ae72-f6e5c7f91d00"
/>
toshmukhamedov pushed a commit to toshmukhamedov/zed that referenced this pull request Mar 20, 2026
Continue zed-industries#45957 zed-industries#46906 to fix font render issue again.

Release Notes:

- Fixed macOS font render clipped bug when use `.SystemUIFont`.

| .SystemUIFont | .ZedMono |
| --- | --- |
| <img width="1034" height="978" alt="image"
src="https://github.com/user-attachments/assets/96b815a1-9484-4a38-8391-a4af3db51a36"
/> | <img width="1034" height="978" alt="image"
src="https://github.com/user-attachments/assets/1aaece42-9acd-47b0-a0a0-3cb425f40301"
/> |

```bash
cargo run -p gpui --example text
```

Test in Zed with `.ZedMono` font:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/1e44d186-cee5-4f54-910a-4c4602ca010e"
/>

With `.ZedSans`:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/1e502f3e-794c-4082-9faf-5a920adc1214"
/>

`Monaco`:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/906a3fd2-715a-4f53-b6fe-4614f4c6edab"
/>

`Menlo`:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/a8f8c302-2083-477c-ae72-f6e5c7f91d00"
/>
AmaanBilwar pushed a commit to AmaanBilwar/zed that referenced this pull request Mar 23, 2026
Continue zed-industries#45957 zed-industries#46906 to fix font render issue again.

Release Notes:

- Fixed macOS font render clipped bug when use `.SystemUIFont`.

| .SystemUIFont | .ZedMono |
| --- | --- |
| <img width="1034" height="978" alt="image"
src="https://github.com/user-attachments/assets/96b815a1-9484-4a38-8391-a4af3db51a36"
/> | <img width="1034" height="978" alt="image"
src="https://github.com/user-attachments/assets/1aaece42-9acd-47b0-a0a0-3cb425f40301"
/> |

```bash
cargo run -p gpui --example text
```

Test in Zed with `.ZedMono` font:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/1e44d186-cee5-4f54-910a-4c4602ca010e"
/>

With `.ZedSans`:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/1e502f3e-794c-4082-9faf-5a920adc1214"
/>

`Monaco`:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/906a3fd2-715a-4f53-b6fe-4614f4c6edab"
/>

`Menlo`:

<img width="815" height="844" alt="image"
src="https://github.com/user-attachments/assets/a8f8c302-2083-477c-ae72-f6e5c7f91d00"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶 size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants