# gpui: Support dynamic font installation \(\#63498\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 9e6e14160c192f682c4d35f4e8d420cc0577ad5f

Requested commit: 9e6e14160c192f682c4d35f4e8d420cc0577ad5f

Commit: 9e6e14160c192f682c4d35f4e8d420cc0577ad5f

Tree: 412391985a83eda09945082384da876bb4b29213

Author: Lukas Wirth

Committer: GitHub

## Message

```
gpui: Support dynamic font installation (#63498)

Browser applications cannot rely on operating-system font discovery, but
embedding comprehensive emoji and CJK fonts makes the initial
WebAssembly payload prohibitively large. GPUI previously offered no
structured way to learn that fallback was exhausted, and adding a font
at runtime left descriptor and line-layout caches shaped against the old
font database.

This change lets WGPU text systems report unresolved grapheme clusters
through `App::on_missing_glyphs`. GPUI invokes one replaceable
application callback after shaping, carrying each complete grapheme and
whether its source run is proportional or monospace. Reports are
deduplicated and delivered through a bounded, nonblocking channel;
reporting remains disabled until the callback is installed, and queued
reports from an earlier font generation are discarded.

Successful font installation now advances a font generation. GPUI clears
descriptor and platform family resolution, reuses stable font IDs for
unchanged faces while refreshing their fallback chains, and invalidates
each window's current and previous line-layout caches when it observes
the new generation. This supplies the GPUI half of an on-demand web font
loader; fetching and selecting font assets remains application-owned.

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
```

## Parents

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

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