Commit 97b4299
gpui: Do not render ligatures between different styled text runs (#43080)
An attempt to re-land #41043
Part of #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 <[email protected]>1 parent 404ee53 commit 97b4299
File tree
2 files changed
+19
-2
lines changed- crates/gpui/src/platform
- mac
- windows
2 files changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| |||
444 | 445 | | |
445 | 446 | | |
446 | 447 | | |
447 | | - | |
| 448 | + | |
| 449 | + | |
448 | 450 | | |
449 | 451 | | |
450 | 452 | | |
451 | 453 | | |
452 | 454 | | |
453 | 455 | | |
454 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
455 | 462 | | |
456 | 463 | | |
457 | 464 | | |
458 | 465 | | |
459 | 466 | | |
460 | 467 | | |
461 | 468 | | |
| 469 | + | |
462 | 470 | | |
463 | 471 | | |
464 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| 611 | + | |
611 | 612 | | |
612 | 613 | | |
613 | 614 | | |
| |||
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
| 620 | + | |
619 | 621 | | |
620 | 622 | | |
621 | 623 | | |
| |||
636 | 638 | | |
637 | 639 | | |
638 | 640 | | |
639 | | - | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
640 | 647 | | |
641 | 648 | | |
642 | 649 | | |
| 650 | + | |
| 651 | + | |
643 | 652 | | |
644 | 653 | | |
645 | 654 | | |
| |||
0 commit comments