max / shop
- Co-Authored-By
- Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 files changed,
+8 insertions,
-5 deletions
| @@ -32,9 +32,13 @@ | |||
| 32 | 32 | use wayland_client::protocol::{wl_output, wl_seat, wl_surface}; | |
| 33 | 33 | ||
| 34 | 34 | const INITIAL: (u32, u32) = (960, 540); | |
| 35 | - | const FONT_PATH: &str = "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf"; | |
| 35 | + | /// IosevkaTerm Nerd Font Mono, terminal-optimized variant of Iosevka with | |
| 36 | + | /// nerd-font glyphs baked in. Bundled so starship, yazi, helix and friends | |
| 37 | + | /// get their icons without a system font install. ~13 MB in the binary. | |
| 38 | + | const FONT_BYTES: &[u8] = | |
| 39 | + | include_bytes!("../../../assets/IosevkaTermNerdFontMono-Regular.ttf"); | |
| 36 | 40 | const FONT_PX: f32 = 14.0; | |
| 37 | - | const CELL_ADVANCE: f32 = 8.5; | |
| 41 | + | const CELL_ADVANCE: f32 = 8.0; | |
| 38 | 42 | const CELL_HEIGHT: f32 = 17.0; | |
| 39 | 43 | const PAD_X: f32 = 10.0; | |
| 40 | 44 | const PAD_Y: f32 = 6.0; | |
| @@ -60,8 +64,7 @@ | |||
| 60 | 64 | ) | |
| 61 | 65 | .init(); | |
| 62 | 66 | ||
| 63 | - | let font_data = std::fs::read(FONT_PATH) | |
| 64 | - | .map_err(|e| anyhow::anyhow!("read font {FONT_PATH}: {e}"))?; | |
| 67 | + | let font_data: Vec<u8> = FONT_BYTES.to_vec(); | |
| 65 | 68 | ||
| 66 | 69 | let shell = std::env::var("SHELL").unwrap_or_else(|_| "/bin/bash".into()); | |
| 67 | 70 | let cols_initial = grid_cols(INITIAL.0); | |
| @@ -163,7 +166,7 @@ | |||
| 163 | 166 | pty, | |
| 164 | 167 | grid, | |
| 165 | 168 | parser, | |
| 166 | - | font_data: std::fs::read(FONT_PATH)?, | |
| 169 | + | font_data: FONT_BYTES.to_vec(), | |
| 167 | 170 | scale: 1, | |
| 168 | 171 | keyboard: None, | |
| 169 | 172 | modifiers: Modifiers::default(), |
Binary file