From 8daf90d49bb342416477bf39f8c1a2c5683e3f58 Mon Sep 17 00:00:00 2001 From: Badless Date: Thu, 28 Nov 2024 17:13:59 +0100 Subject: [PATCH 1/4] Updated egui to 0.29.1 --- Cargo.toml | 4 ++-- examples/rust_logo.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9ded3ae..be38934 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,10 @@ keywords = ["egui", "nerdfonts", "icons", "symbols", "font"] categories = ["gui"] [dependencies] -egui = { version = "0.27.2", default-features = false } +egui = { version = "0.29.1", default-features = false } [dev-dependencies] -eframe = "0.27.2" +eframe = "0.29.1" [[example]] name = "rust_logo" diff --git a/examples/rust_logo.rs b/examples/rust_logo.rs index 8dfd912..2ac4ab8 100644 --- a/examples/rust_logo.rs +++ b/examples/rust_logo.rs @@ -2,7 +2,7 @@ fn main() { eframe::run_native( "egui_nerdfonts demo", eframe::NativeOptions::default(), - Box::new(|cc| Box::new(Demo::new(cc))), + Box::new(|cc| Ok(Box::new(Demo::new(cc)))), ) .unwrap(); } From c41cda63dbdaf23aaa8403babe6d42dd3a6d3b59 Mon Sep 17 00:00:00 2001 From: DevBrainless <79766539+Badless@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:21:05 +0100 Subject: [PATCH 2/4] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index be38934..7f6fb49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "egui_nerdfonts" description = "Nerdfonts icons for egui" -version = "0.1.3" +version = "0.1.4" edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/bernsteining/egui_nerdfonts" From 327a951e099f711d9805c1bb5457d1331dfb92f1 Mon Sep 17 00:00:00 2001 From: DevBrainless <79766539+Badless@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:32:58 +0100 Subject: [PATCH 3/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a953da..4dbdccc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Bundles [Nerd Fonts icons](https://www.nerdfonts.com/cheat-sheet) for [egui](htt Add the crate as a dependency in Cargo.toml: ```toml -egui_nerdfonts = "0.1.3" +egui_nerdfonts = "0.1.4" ``` or type `cargo add egui_nerdfonts`, in your project. @@ -65,4 +65,4 @@ with TTFont( symbol_name = char[1].upper().replace('-', '_').replace(' ', '_').replace('#', '_').replace('!', '') code = r"\u" + "{" + f"{char[0]:X}" + "}" print(f"pub const {symbol_name}: &str = \"{code}\";") -``` \ No newline at end of file +``` From ff657ef011c39557fddcc290e0de175482d66604 Mon Sep 17 00:00:00 2001 From: Badless Date: Tue, 17 Dec 2024 22:26:26 +0100 Subject: [PATCH 4/4] Update egui to 0.30 --- Cargo.toml | 4 ++-- src/variants/mod.rs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7f6fb49..f741bdd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,10 @@ keywords = ["egui", "nerdfonts", "icons", "symbols", "font"] categories = ["gui"] [dependencies] -egui = { version = "0.29.1", default-features = false } +egui = { version = "0.30", default-features = false } [dev-dependencies] -eframe = "0.29.1" +eframe = "0.30" [[example]] name = "rust_logo" diff --git a/src/variants/mod.rs b/src/variants/mod.rs index 8e34a51..1bf5e0a 100644 --- a/src/variants/mod.rs +++ b/src/variants/mod.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + pub mod regular; #[derive(Debug, Clone, Copy)] @@ -6,10 +8,10 @@ pub enum Variant { } impl Variant { - pub fn font_data(&self) -> egui::FontData { + pub fn font_data(&self) -> Arc { let mut font_data = egui::FontData::from_static(include_bytes!("../../fonts/nerdfonts_regular.ttf")); font_data.tweak.y_offset_factor = 0.0; - font_data + Arc::new(font_data) } }