# gpui_macos: Fix glyph rendering when fonts share a PostScript name \(\#57250\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 20a93f6195ca8e9f0a748038317a5efe1be3e482

Requested commit: 20a93f6195ca8e9f0a748038317a5efe1be3e482

Commit: 20a93f6195ca8e9f0a748038317a5efe1be3e482

Tree: c0aeda8e3e62b5a17a96ed07a194688fe97a5a05

Author: Ankan Misra

Committer: GitHub

## Message

```
gpui_macos: Fix glyph rendering when fonts share a PostScript name (#57250)

On macOS, `load_family` was inserting every font into
`font_ids_by_postscript_name` without checking for duplicates. When two
installed font files claim the same PostScript name — typically an older
Geist Mono left behind alongside the current brew cask — the second
insert overwrote the first. After shaping, `id_for_native_font` looked
up that PostScript name and got back the *other* font's `FontId`, so the
rasterizer drew glyphs from the wrong table
See #55472 for the screenshot

This adds a local `HashSet` to dedup within a single `load_family` call.
Scoping it to one call (rather than the global map) matters: the same
family gets reloaded under different `FontKey`s when `FontFeatures` or
`FontFallbacks` change, and a global check would skip every font on the
reload and break weight selection.

Cross-family PostScript name collisions and CoreText fallback
substitutions that re-introduce a conflict are out of scope here

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed glyph rendering when fonts share a PostScript name on macOS

---------

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

## Parents

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

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