Load only Zed Sans when building test AppState

This commit is contained in:
Antonio Scandurra 2022-02-18 15:22:13 +01:00
parent 38e4ec9157
commit b67a2012b2

View file

@ -52,11 +52,9 @@ pub fn test_app_state(cx: &mut MutableAppContext) -> Arc<AppState> {
fn build_settings(cx: &gpui::AppContext) -> Settings { fn build_settings(cx: &gpui::AppContext) -> Settings {
lazy_static::lazy_static! { lazy_static::lazy_static! {
static ref DEFAULT_THEME: parking_lot::Mutex<Option<Arc<Theme>>> = Default::default(); static ref DEFAULT_THEME: parking_lot::Mutex<Option<Arc<Theme>>> = Default::default();
static ref FONTS: Vec<Arc<Vec<u8>>> = Assets static ref FONTS: Vec<Arc<Vec<u8>>> = vec![
.list("fonts") Assets.load("fonts/zed-sans/zed-sans-regular.ttf").unwrap().to_vec().into()
.into_iter() ];
.map(|f| Arc::new(Assets.load(&f).unwrap().to_vec()))
.collect();
} }
cx.platform().fonts().add_fonts(&FONTS).unwrap(); cx.platform().fonts().add_fonts(&FONTS).unwrap();
@ -72,5 +70,5 @@ fn build_settings(cx: &gpui::AppContext) -> Settings {
theme theme
}; };
Settings::new("Inconsolata", cx.font_cache(), theme).unwrap() Settings::new("Zed Sans", cx.font_cache(), theme).unwrap()
} }