zed/crates/gpui/src
Marshall Bowers d0b15ed940
Report which requested font families are not present on the system (#3006)
This PR improves the error message when `FontCache.load_family` attempts
to load a font that is not present on the system.

I ran into this while trying to run the `storybook` for the first time.
The error message indicated that a font family was not found, but did
not provide any information as to which font family was being loaded.

### Before

```
   Compiling storybook v0.1.0 (/Users/maxdeviant/projects/zed/crates/storybook)
    Finished dev [unoptimized + debuginfo] target(s) in 8.52s
     Running `/Users/maxdeviant/projects/zed/target/debug/storybook`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: could not find a non-empty font family matching one of the given names', crates/theme/src/theme_settings.rs:132:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
libc++abi: terminating due to uncaught foreign exception
fish: Job 1, 'cargo run' terminated by signal SIGABRT (Abort)
```

### After

```
   Compiling storybook v0.1.0 (/Users/maxdeviant/projects/zed/crates/storybook)
    Finished dev [unoptimized + debuginfo] target(s) in 7.90s
     Running `/Users/maxdeviant/projects/zed/target/debug/storybook`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: could not find a non-empty font family matching one of the given names: `Zed Mono`', crates/theme/src/theme_settings.rs:132:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
libc++abi: terminating due to uncaught foreign exception
fish: Job 1, 'cargo run' terminated by signal SIGABRT (Abort)
```

Release Notes:

- N/A
2023-09-22 15:27:42 -04:00
..
app Put Theme behind an Arc (#3017) 2023-09-22 13:35:30 -04:00
elements Eliminate PaintContext 2023-09-11 09:00:59 -06:00
keymap_matcher Fix multi-key shortcuts with modifiers 2023-09-14 14:35:17 -06:00
platform Fix multi-key shortcuts with modifiers 2023-09-14 14:35:17 -06:00
scene
views Add buttons for opening channel notes and joining call, in chat panel header 2023-09-14 18:05:44 -07:00
app.rs chore: Hoist non-generic part out of add_action_internal. (#2981) 2023-09-18 11:55:44 +02:00
assets.rs
clipboard.rs
color.rs
elements.rs Eliminate PaintContext 2023-09-11 09:00:59 -06:00
executor.rs
font_cache.rs Report which requested font families are not present on the system (#3006) 2023-09-22 15:27:42 -04:00
fonts.rs
geometry.rs Checkpoint 2023-09-18 20:17:27 -06:00
gpui.rs Checkpoint 2023-09-06 15:22:35 -06:00
image_cache.rs Add support for fetching/rendering images 2023-09-06 17:13:43 -06:00
image_data.rs
json.rs
keymap_matcher.rs Fix multi-key shortcuts with modifiers 2023-09-14 14:35:17 -06:00
platform.rs
scene.rs Checkpoint 2023-09-08 16:25:10 -06:00
test.rs
text_layout.rs Checkpoint 2023-09-08 16:25:10 -06:00
util.rs
views.rs Restructure collab panel to allow opening chat + notes w/ one click 2023-09-08 17:06:39 -07:00