diff --git a/Cargo.toml b/Cargo.toml index a839dda..957da48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/Ubuntu-Light.ttf b/src/Ubuntu-Light.ttf new file mode 100755 index 0000000..0e9f90d Binary files /dev/null and b/src/Ubuntu-Light.ttf differ diff --git a/src/egui_app.rs b/src/egui_app.rs index 1781b7a..27581ff 100644 --- a/src/egui_app.rs +++ b/src/egui_app.rs @@ -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")