From 9b23b535e256840717d8b6476bfdc41d2a51e580 Mon Sep 17 00:00:00 2001 From: pml68 Date: Sun, 8 Dec 2024 00:15:12 +0100 Subject: feat: switch to `hecrj/iced_fontello` for icon font management --- iced_builder/src/icon.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 iced_builder/src/icon.rs (limited to 'iced_builder/src/icon.rs') diff --git a/iced_builder/src/icon.rs b/iced_builder/src/icon.rs new file mode 100644 index 0000000..334f820 --- /dev/null +++ b/iced_builder/src/icon.rs @@ -0,0 +1,23 @@ +// Generated automatically by iced_fontello at build time. +// Do not edit manually. +// 02c7558d187cdc056fdd0e6a638ef805fa10f5955f834575e51d75acd35bc70e +use iced::widget::{text, Text}; +use iced::Font; + +pub const FONT: &[u8] = include_bytes!("../fonts/icons.ttf"); + +pub fn copy<'a>() -> Text<'a> { + icon("\u{F1C9}") +} + +pub fn open<'a>() -> Text<'a> { + icon("\u{F115}") +} + +pub fn save<'a>() -> Text<'a> { + icon("\u{1F4BE}") +} + +fn icon<'a>(codepoint: &'a str) -> Text<'a> { + text(codepoint).font(Font::with_name("icons")) +} -- cgit v1.2.3