# gpui: Do not render ligatures between different styled text runs \(\#43080\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 97b429953eb616d98032e7a74e2c98451210b183

Requested commit: 97b429953eb616d98032e7a74e2c98451210b183

Commit: 97b429953eb616d98032e7a74e2c98451210b183

Tree: 6731899ebb27e0fa8a8face964e7022bc28b79c6

Author: Kirill Bulatov

Committer: GitHub

## Message

```
gpui: Do not render ligatures between different styled text runs (#43080)

An attempt to re-land https://github.com/zed-industries/zed/pull/41043
Part of https://github.com/zed-industries/zed/issues/5259 (as `>>>`
forms a ligature that we need to break into differently colored tokens)

Before:

<img width="301" height="86" alt="image"
src="https://github.com/user-attachments/assets/e710391a-b8ad-4343-8344-c86fc5cb86b6"
/>

and


https://github.com/user-attachments/assets/ae77ba64-ca50-4b5d-9ee4-a7d46fcaeb34


After:
<img width="1254" height="302" alt="image"
src="https://github.com/user-attachments/assets/7fd5dba5-d798-4153-acf2-e38a1cb712ae"
/>


When certain combination of characters forms a ligature, it takes the
color of the first character.
Even though the runs are split already by color and other properties,
the underlying font system merges the runs together.

Attempts to modify color and other, unrelated to font size, parameters,
did not help on macOS, hence a somewhat odd approach was taken: runs get
interleaved font sizes: normal and "normal + a tiny bit more".
This is the only option that helped splitting the ligatures, and seems
to render fine.

Release Notes:

- Fixed ligatures forming between different text kinds

---------

Co-authored-by: Lukas Wirth <lukas@zed.dev>
```

## Parents

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

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