Skip to content

Commit

Permalink
use JetBrains Mono as the monospaced font
Browse files Browse the repository at this point in the history
  • Loading branch information
reykjalin committed Mar 24, 2024
1 parent b82576a commit 0c13bfa
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 0 deletions.
Binary file added assets/JetBrainsMonoNL-Bold.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-BoldItalic.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-ExtraBold.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-ExtraBoldItalic.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-ExtraLight.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-ExtraLightItalic.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-Italic.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-Light.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-LightItalic.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-Medium.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-MediumItalic.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-Regular.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-SemiBold.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-SemiBoldItalic.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-Thin.ttf
Binary file not shown.
Binary file added assets/JetBrainsMonoNL-ThinItalic.ttf
Binary file not shown.
20 changes: 20 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ impl TemplateApp {
return eframe::get_value(storage, eframe::APP_KEY).unwrap_or_default();
}

// FIXME: Merge JetBrains Mono font variants into one .ttf file to support
// bolds/italic/boldi-italic etc.
// See https://github.com/emilk/egui/discussions/1862.

let mut fonts = egui::FontDefinitions::default();

fonts.font_data.insert(
"JetBrains Mono".to_owned(),
egui::FontData::from_static(include_bytes!("../assets/JetBrainsMonoNL-Regular.ttf")),
);

// Set JetBrains Mono as highest priority for monospaced fonts.
fonts
.families
.entry(egui::FontFamily::Monospace)
.or_default()
.insert(0, "JetBrains Mono".to_owned());

cc.egui_ctx.set_fonts(fonts);

Default::default()
}
}
Expand Down

0 comments on commit 0c13bfa

Please sign in to comment.