1mod assets;
11mod cache;
12pub mod components;
13pub mod interaction;
14pub mod motion;
15pub mod shapes;
16pub mod syntax;
17pub mod theme;
18
19use std::borrow::Cow;
20
21use gpui::App;
22
23pub use assets::{Assets, ICON_PREFIX};
24pub use components::*;
25pub use motion::{MotionSettings, Spring};
26pub use shapes::{Morph, ShapeName, Tone};
27pub use syntax::{SyntaxHighlighter, SyntaxLines, SyntaxPalette, TokenKind};
28pub use theme::{Elevation, Scheme, SchemeVariant, Theme, corner};
29
30pub fn init(cx: &mut App) {
32 let fonts: Vec<Cow<'static, [u8]>> = vec![
33 Cow::Borrowed(include_bytes!("../assets/fonts/Inter-Regular.ttf")),
36 Cow::Borrowed(include_bytes!("../assets/fonts/Inter-Medium.ttf")),
37 Cow::Borrowed(include_bytes!("../assets/fonts/Inter-SemiBold.ttf")),
38 Cow::Borrowed(include_bytes!("../assets/fonts/Inter-Bold.ttf")),
39 Cow::Borrowed(include_bytes!("../assets/fonts/Inter-Italic.ttf")),
40 Cow::Borrowed(include_bytes!("../assets/fonts/Roboto.ttf")),
41 ];
42 if let Err(err) = cx.text_system().add_fonts(fonts) {
43 log::warn!("gpui_m3: could not load Inter and Roboto: {err}");
44 }
45 if !cx.has_global::<Theme>() {
46 cx.set_global(Theme::new(false, None));
47 }
48 components::bind_text_field_keys(cx);
49 components::bind_text_area_keys(cx);
50 components::bind_code_editor_keys(cx);
51 components::bind_image_cropper_keys(cx);
52 components::bind_command_palette_keys(cx);
53 components::bind_suggestion_keys(cx);
55 if !cx.has_global::<MotionSettings>() {
56 cx.set_global(MotionSettings::default());
57 }
58}