# gpui: Add dynamic padding to prevent glyph clipping in text rendering on macOS \(\#45957\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 83ca31055cf3e56aa8a704ac49e1686434f4e640

Requested commit: 83ca31055cf3e56aa8a704ac49e1686434f4e640

Commit: 83ca31055cf3e56aa8a704ac49e1686434f4e640

Tree: 141ceafeccae28ac92dc401285644e8cf9eb4f8b

Author: Jony Lab

Committer: GitHub

## Message

```
gpui: Add dynamic padding to prevent glyph clipping in text rendering on macOS (#45957)

Here may caused by [font-kit](https://github.com/servo/font-kit), I was
tried to use
[render-glyph](https://github.com/servo/font-kit/blob/main/examples/render-glyph.rs)
example and also use the same option with `Transform2F::from_scale(2.0)`
for `raster_bounds`.

Then the `raster_bounds` will result same issue like the GPUI's font
rendering issue.

| Transform2F::default() | Transform2F::from_scale(2.) |
| --- | -- |
| <img width="943" height="638" alt="image"
src="https://github.com/user-attachments/assets/9b827c63-2cbb-45d3-bd62-b0e058a46614"
/> | <img width="943" height="638" alt="image"
src="https://github.com/user-attachments/assets/ee977a9b-2a7b-4b78-873b-146b2953c0db"
/> |

## Before

<img width="1032" height="1398" alt="SCR-20260105-pgcp-2"
src="https://github.com/user-attachments/assets/ebeb04cc-3a92-4333-99fc-8733a63b2553"
/>

## After

<img width="1032" height="1414" alt="SCR-20260105-pfny-1"
src="https://github.com/user-attachments/assets/063d0452-56d7-447c-810b-fee7c891235b"
/>

Release Notes:

- Fixed incorrect rendering of characters at large font sizes on macOS

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Jason Lee <huacnlee@gmail.com>
```

## Parents

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

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