only use Ubuntu-Light Font (saves space)

This commit is contained in:
Simon Gardling 2022-02-28 09:16:45 -05:00
parent 3b0c2df9e0
commit f5ce5b9f2f
3 changed files with 23 additions and 3 deletions

View File

@ -15,8 +15,8 @@ strip = true
[dependencies]
meval = { git = "https://github.com/Titaniumtown/meval-rs.git" }
egui = { git = "https://github.com/Titaniumtown/egui", branch = "patch-1" }
eframe = { git = "https://github.com/Titaniumtown/egui", branch = "patch-1" }
egui = { git = "https://github.com/Titaniumtown/egui", branch = "patch-1", default-features = false }
eframe = { git = "https://github.com/Titaniumtown/egui", branch = "patch-1", default-features = false, features = ["egui_glow"] }
instant = { version = "0.1.12", features = ["wasm-bindgen"] }
git-version = "0.3.5"

BIN
src/Ubuntu-Light.ttf Executable file

Binary file not shown.

View File

@ -6,7 +6,7 @@ use eframe::{egui, epi};
use egui::plot::{Line, Plot, Values};
use egui::widgets::plot::BarChart;
use egui::widgets::Button;
use egui::{Color32, Vec2};
use egui::{Color32, Vec2, FontData, FontFamily};
use git_version::git_version;
// Grabs git version on compile time
@ -78,6 +78,26 @@ impl epi::App for MathApp {
// Note: This Instant implementation does not show microseconds when using wasm.
let start = instant::Instant::now();
let mut fonts = egui::FontDefinitions::default();
fonts.font_data.insert(
"Ubuntu-Light".to_owned(),
FontData::from_static(include_bytes!("Ubuntu-Light.ttf")),
);
fonts.families.insert(
FontFamily::Monospace,
vec![
"Ubuntu-Light".to_owned(),
],
);
fonts.families.insert(
FontFamily::Proportional,
vec![
"Ubuntu-Light".to_owned(),
],
);
ctx.set_fonts(fonts);
// Cute little window that lists supported functions!
// TODO: add more detail
egui::Window::new("Supported Functions")