# Try to load fallback fonts instead of panicking when a font is not found \(\#3891\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e4aa7ba4f262eb794b798107efbae04fbecb2d87

Requested commit: e4aa7ba4f262eb794b798107efbae04fbecb2d87

Commit: e4aa7ba4f262eb794b798107efbae04fbecb2d87

Tree: d6440402bb9f3065ee6877a61a5a03a53920a1fb

Author: Marshall Bowers

Committer: GitHub

## Message

```
Try to load fallback fonts instead of panicking when a font is not found (#3891)

This PR adjusts our font resolution code to attempt to use a fallback
font if the specified font cannot be found.

Right now our fallback font stack is `Zed Mono`, followed by `Helvetica`
(in practice we should always be able to resolve `Zed Mono` since we
bundle it with the app).

In the future we'll want to surface the ability to set the fallback font
stack from GPUI consumers, and potentially even support specifying font
stacks in the user settings (as opposed to a single font family).

Release Notes:

- Fixed a panic when trying to load a font that could not be found.
```

## Parents

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

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