gui: Add iconex icons

This commit is contained in:
edouard 2023-05-09 16:24:30 +02:00
parent 7d4ac9d56a
commit 1fd53c0ff4
33 changed files with 315 additions and 394 deletions

View File

@ -3,9 +3,7 @@ use iced::{widget::Space, Alignment, Length};
use liana_ui::{
color,
component::{amount::*, badge, button, text::*},
icon,
image::*,
theme,
icon, theme,
util::Collection,
widget::*,
};
@ -182,7 +180,7 @@ pub fn coin_sequence_label<'a, T: 'a>(seq: u32, timelock: u32) -> Container<'a,
Container::new(
Row::new()
.spacing(5)
.push(clock_red_icon().width(Length::Units(20)))
.push(icon::clock_icon().width(Length::Units(20)))
.push(p2_regular("Expired"))
.align_items(Alignment::Center),
)
@ -192,7 +190,7 @@ pub fn coin_sequence_label<'a, T: 'a>(seq: u32, timelock: u32) -> Container<'a,
Container::new(
Row::new()
.spacing(5)
.push(clock_red_icon().width(Length::Units(20)))
.push(icon::clock_icon().width(Length::Units(20)))
.push(p2_regular(expire_message(seq)))
.align_items(Alignment::Center),
)
@ -202,7 +200,7 @@ pub fn coin_sequence_label<'a, T: 'a>(seq: u32, timelock: u32) -> Container<'a,
Container::new(
Row::new()
.spacing(5)
.push(clock_icon().width(Length::Units(20)))
.push(icon::clock_icon().width(Length::Units(20)))
.push(p2_regular(expire_message(seq)).style(color::GREY_3))
.align_items(Alignment::Center),
)

View File

@ -23,7 +23,9 @@ use iced::{
use liana_ui::{
color,
component::{button, text::*},
icon::{cross_icon, home_icon, receive_icon, send_icon, settings_icon},
icon::{
coins_icon, cross_icon, history_icon, home_icon, receive_icon, send_icon, settings_icon,
},
image::*,
theme,
util::Collection,
@ -54,150 +56,55 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> {
let transactions_button = if *menu == Menu::Transactions {
row!(
Button::new(
row!(
history_icon().width(Length::Units(20)),
text("Transactions")
)
.spacing(10)
.padding(10)
.align_items(iced::Alignment::Center),
)
.style(theme::Button::Menu(true))
.on_press(Message::Menu(Menu::Transactions))
.width(iced::Length::Fill),
button::menu_active(Some(history_icon()), "Transactions")
.on_press(Message::Menu(Menu::Transactions))
.width(iced::Length::Fill),
menu_green_bar()
)
} else {
row!(Button::new(
row!(
history_icon().width(Length::Units(20)),
text("Transactions")
)
.spacing(10)
.padding(10)
.align_items(iced::Alignment::Center),
)
.style(theme::Button::Menu(false))
.on_press(Message::Menu(Menu::Transactions))
.width(iced::Length::Fill))
row!(button::menu(Some(history_icon()), "Transactions")
.on_press(Message::Menu(Menu::Transactions))
.width(iced::Length::Fill))
};
let coins_button = if *menu == Menu::Coins {
row!(
Button::new(
Container::new(
Row::new()
.push(coins_icon().width(Length::Units(20)))
.push(text("Coins"))
.spacing(10)
.width(iced::Length::Fill)
.align_items(iced::Alignment::Center),
)
.width(iced::Length::Fill)
.padding(10)
.center_x(),
)
.style(theme::Button::Menu(true))
.on_press(Message::Reload)
.width(iced::Length::Fill),
button::menu_active(Some(coins_icon()), "Coins")
.on_press(Message::Reload)
.width(iced::Length::Fill),
menu_green_bar()
)
} else {
row!(Button::new(
Container::new(
Row::new()
.push(coins_icon().width(Length::Units(20)))
.push(text("Coins"))
.spacing(10)
.width(iced::Length::Fill)
.align_items(iced::Alignment::Center),
)
.width(iced::Length::Fill)
.padding(10)
.center_x(),
)
.style(theme::Button::Menu(false))
.on_press(Message::Menu(Menu::Coins))
.width(iced::Length::Fill))
row!(button::menu(Some(coins_icon()), "Coins")
.style(theme::Button::Menu(false))
.on_press(Message::Menu(Menu::Coins))
.width(iced::Length::Fill))
};
let psbt_button = if *menu == Menu::PSBTs {
row!(
Button::new(
Container::new(
Row::new()
.push(history_icon().width(Length::Units(20)))
.push(text("PSBTs"))
.spacing(10)
.width(iced::Length::Fill)
.align_items(iced::Alignment::Center),
)
.width(iced::Length::Fill)
.padding(10)
.center_x(),
)
.style(theme::Button::Menu(true))
.on_press(Message::Menu(Menu::PSBTs))
.width(iced::Length::Fill),
button::menu_active(Some(history_icon()), "PSBTs")
.on_press(Message::Menu(Menu::PSBTs))
.width(iced::Length::Fill),
menu_green_bar()
)
} else {
row!(Button::new(
Container::new(
Row::new()
.push(history_icon().width(Length::Units(20)))
.push(text("PSBTs"))
.spacing(10)
.width(iced::Length::Fill)
.align_items(iced::Alignment::Center),
)
.width(iced::Length::Fill)
.padding(10)
.center_x(),
)
.style(theme::Button::Menu(false))
.on_press(Message::Menu(Menu::PSBTs))
.width(iced::Length::Fill))
row!(button::menu(Some(history_icon()), "PSBTs")
.on_press(Message::Menu(Menu::PSBTs))
.width(iced::Length::Fill))
};
let spend_button = if *menu == Menu::CreateSpendTx {
row!(
Button::new(
Container::new(
Row::new()
.push(send_icon())
.push(text("Send"))
.spacing(10)
.width(iced::Length::Fill)
.align_items(iced::Alignment::Center),
)
.width(iced::Length::Fill)
.padding(10)
.center_x(),
)
.style(theme::Button::Menu(true))
.on_press(Message::Menu(Menu::CreateSpendTx))
.width(iced::Length::Fill),
button::menu_active(Some(send_icon()), "Send")
.on_press(Message::Menu(Menu::CreateSpendTx))
.width(iced::Length::Fill),
menu_green_bar()
)
} else {
row!(Button::new(
Container::new(
Row::new()
.push(send_icon())
.push(text("Send"))
.spacing(10)
.width(iced::Length::Fill)
.align_items(iced::Alignment::Center),
)
.width(iced::Length::Fill)
.padding(10)
.center_x(),
)
.style(theme::Button::Menu(false))
.on_press(Message::Menu(Menu::CreateSpendTx))
.width(iced::Length::Fill))
row!(button::menu(Some(send_icon()), "Send")
.on_press(Message::Menu(Menu::CreateSpendTx))
.width(iced::Length::Fill))
};
let receive_button = if *menu == Menu::Receive {

View File

@ -1,7 +1,7 @@
use std::collections::HashMap;
use iced::{
widget::{tooltip, Space},
widget::{checkbox, tooltip, Space},
Alignment, Length,
};
@ -116,68 +116,60 @@ pub fn recovery_path_view<'a>(
selected: bool,
) -> Element<'a, Message> {
Container::new(
Button::new(
Row::new()
.push(if selected {
icon::square_check_icon()
} else {
icon::square_icon()
})
.push(
Column::new()
.push(
Row::new()
.align_items(Alignment::Center)
.spacing(10)
.push(
text(format!(
"{} signature{} from",
threshold,
if threshold > 1 { "s" } else { "" }
))
.bold(),
)
.push(origins.iter().fold(
Row::new().align_items(Alignment::Center).spacing(5),
|row, (fg, _)| {
row.push(if let Some(alias) = key_aliases.get(fg) {
Container::new(
tooltip::Tooltip::new(
Container::new(text(alias)).padding(3).style(
theme::Container::Pill(theme::Pill::Simple),
),
fg.to_string(),
tooltip::Position::Bottom,
)
.style(theme::Container::Card(theme::Card::Simple)),
Row::new()
.push(checkbox("", selected, move |_| {
Message::CreateSpend(CreateSpendMessage::SelectPath(index))
}))
.push(
Column::new()
.push(
Row::new()
.align_items(Alignment::Center)
.spacing(10)
.push(
text(format!(
"{} signature{} from",
threshold,
if threshold > 1 { "s" } else { "" }
))
.bold(),
)
.push(origins.iter().fold(
Row::new().align_items(Alignment::Center).spacing(5),
|row, (fg, _)| {
row.push(if let Some(alias) = key_aliases.get(fg) {
Container::new(
tooltip::Tooltip::new(
Container::new(text(alias)).padding(3).style(
theme::Container::Pill(theme::Pill::Simple),
),
fg.to_string(),
tooltip::Position::Bottom,
)
} else {
Container::new(text(fg.to_string()))
.padding(3)
.style(theme::Container::Pill(theme::Pill::Simple))
})
},
)),
)
.push(
Row::new()
.spacing(5)
.push(text("can recover"))
.push(text(format!(
"{} coin{} totalling",
number_of_coins,
if number_of_coins > 0 { "s" } else { "" }
)))
.push(amount(&total_amount)),
),
)
.align_items(Alignment::Center)
.spacing(20),
)
.padding(10)
.width(Length::Fill)
.on_press(Message::CreateSpend(CreateSpendMessage::SelectPath(index)))
.style(theme::Button::TransparentBorder),
.style(theme::Container::Card(theme::Card::Simple)),
)
} else {
Container::new(text(fg.to_string()))
.padding(3)
.style(theme::Container::Pill(theme::Pill::Simple))
})
},
)),
)
.push(
Row::new()
.spacing(5)
.push(text("can recover"))
.push(text(format!(
"{} coin{} totalling",
number_of_coins,
if number_of_coins > 0 { "s" } else { "" }
)))
.push(amount(&total_amount)),
),
)
.align_items(Alignment::Center)
.spacing(20),
)
.style(theme::Container::Card(theme::Card::Simple))
.width(Length::Fill)

View File

@ -91,6 +91,8 @@ fn tx_list_view<'a>(i: usize, tx: &HistoryTransaction) -> Element<'a, Message> {
Row::new()
.push(if tx.is_external() {
badge::receive()
} else if tx.is_self_send() {
badge::cycle()
} else {
badge::spend()
})

View File

@ -43,6 +43,15 @@ pub fn receive<T>() -> Container<'static, T> {
.center_y()
}
pub fn cycle<T>() -> Container<'static, T> {
Container::new(icon::arrow_repeat().width(Length::Units(20)))
.width(Length::Units(40))
.height(Length::Units(40))
.style(theme::Container::Badge(theme::Badge::Standard))
.center_x()
.center_y()
}
pub fn spend<T>() -> Container<'static, T> {
Container::new(icon::send_icon().width(Length::Units(20)))
.width(Length::Units(40))

View File

@ -1,15 +1,17 @@
use crate::{theme, widget::*};
use crate::{color, theme, widget::*};
use iced::widget::{button, container, row};
use iced::{Alignment, Length};
use super::text::text;
pub fn menu<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button<'a, T> {
button::Button::new(content(icon, t).padding(10)).style(theme::Button::Menu(false))
button::Button::new(content(icon.map(|i| i.style(color::GREY_3)), t).padding(10))
.style(theme::Button::Menu(false))
}
pub fn menu_active<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button<'a, T> {
button::Button::new(content(icon, t).padding(10)).style(theme::Button::Menu(true))
button::Button::new(content(icon.map(|i| i.style(color::GREY_3)), t).padding(10))
.style(theme::Button::Menu(true))
}
pub fn alert<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button<'a, T> {

View File

@ -18,7 +18,7 @@ pub fn warning<'a, T: 'a>(message: String) -> Container<'a, T> {
Row::new()
.spacing(20)
.align_items(iced::Alignment::Center)
.push(icon::warning_octagon_icon())
.push(icon::warning_icon())
.push(text(message)),
)
.padding(15)

View File

@ -1,245 +1,180 @@
use crate::widget::*;
use iced::{alignment, Font, Length};
const ICONS: Font = Font::External {
name: "Icons",
const BOOTSTRAP_ICONS: Font = Font::External {
name: "Bootstrap icons",
bytes: include_bytes!("../static/icons/bootstrap-icons.ttf"),
};
fn icon(unicode: char) -> Text<'static> {
fn bootstrap_icon(unicode: char) -> Text<'static> {
Text::new(unicode.to_string())
.font(ICONS)
.font(BOOTSTRAP_ICONS)
.width(Length::Units(20))
.horizontal_alignment(alignment::Horizontal::Center)
.size(20)
}
pub fn cross_icon() -> Text<'static> {
bootstrap_icon('\u{F62A}')
}
pub fn arrow_down() -> Text<'static> {
icon('\u{F128}')
bootstrap_icon('\u{F128}')
}
pub fn arrow_right() -> Text<'static> {
icon('\u{F138}')
}
pub fn arrow_repeat() -> Text<'static> {
icon('\u{F130}')
bootstrap_icon('\u{F138}')
}
pub fn arrow_return_right() -> Text<'static> {
icon('\u{F132}')
bootstrap_icon('\u{F132}')
}
pub fn chevron_right() -> Text<'static> {
icon('\u{F285}')
bootstrap_icon('\u{F285}')
}
pub fn recovery_icon() -> Text<'static> {
icon('\u{F467}')
bootstrap_icon('\u{F467}')
}
pub fn plug_icon() -> Text<'static> {
icon('\u{F4F6}')
bootstrap_icon('\u{F4F6}')
}
pub fn reload_icon() -> Text<'static> {
icon('\u{F130}')
bootstrap_icon('\u{F130}')
}
pub fn import_icon() -> Text<'static> {
icon('\u{F30A}')
bootstrap_icon('\u{F30A}')
}
pub fn wallet_icon() -> Text<'static> {
icon('\u{F615}')
}
pub fn hourglass_icon() -> Text<'static> {
icon('\u{F41F}')
}
pub fn hourglass_done_icon() -> Text<'static> {
icon('\u{F41E}')
}
pub fn vault_icon() -> Text<'static> {
icon('\u{F65A}')
bootstrap_icon('\u{F615}')
}
pub fn bitcoin_icon() -> Text<'static> {
icon('\u{F635}')
}
pub fn history_icon() -> Text<'static> {
icon('\u{F292}')
}
pub fn home_icon() -> Text<'static> {
icon('\u{F3FC}')
}
pub fn unlock_icon() -> Text<'static> {
icon('\u{F600}')
}
pub fn warning_octagon_icon() -> Text<'static> {
icon('\u{F337}')
}
pub fn send_icon() -> Text<'static> {
icon('\u{F144}')
}
pub fn connect_device_icon() -> Text<'static> {
icon('\u{F348}')
}
pub fn connected_device_icon() -> Text<'static> {
icon('\u{F350}')
}
pub fn receive_icon() -> Text<'static> {
icon('\u{F123}')
}
pub fn calendar_icon() -> Text<'static> {
icon('\u{F1E8}')
}
pub fn turnback_icon() -> Text<'static> {
icon('\u{F131}')
}
pub fn vaults_icon() -> Text<'static> {
icon('\u{F1C7}')
}
pub fn coin_icon() -> Text<'static> {
icon('\u{F567}')
}
pub fn settings_icon() -> Text<'static> {
icon('\u{F3E5}')
bootstrap_icon('\u{F635}')
}
pub fn block_icon() -> Text<'static> {
icon('\u{F1C8}')
}
pub fn square_icon() -> Text<'static> {
icon('\u{F584}')
}
pub fn square_check_icon() -> Text<'static> {
icon('\u{F26D}')
}
pub fn circle_check_icon() -> Text<'static> {
icon('\u{F26B}')
}
pub fn circle_cross_icon() -> Text<'static> {
icon('\u{F623}')
}
pub fn network_icon() -> Text<'static> {
icon('\u{F40D}')
bootstrap_icon('\u{F1C8}')
}
pub fn dot_icon() -> Text<'static> {
icon('\u{F287}')
}
pub fn clipboard_icon() -> Text<'static> {
icon('\u{F3C2}')
}
pub fn shield_icon() -> Text<'static> {
icon('\u{F53F}')
}
pub fn shield_notif_icon() -> Text<'static> {
icon('\u{F530}')
}
pub fn shield_check_icon() -> Text<'static> {
icon('\u{F52F}')
}
pub fn person_check_icon() -> Text<'static> {
icon('\u{F4D6}')
bootstrap_icon('\u{F287}')
}
pub fn person_icon() -> Text<'static> {
icon('\u{F4DA}')
bootstrap_icon('\u{F4DA}')
}
pub fn tooltip_icon() -> Text<'static> {
icon('\u{F431}')
bootstrap_icon('\u{F431}')
}
pub fn plus_icon() -> Text<'static> {
icon('\u{F4FE}')
bootstrap_icon('\u{F4FE}')
}
pub fn warning_icon() -> Text<'static> {
icon('\u{F33B}')
bootstrap_icon('\u{F33B}')
}
pub fn chip_icon() -> Text<'static> {
icon('\u{F2D6}')
bootstrap_icon('\u{F2D6}')
}
pub fn trash_icon() -> Text<'static> {
icon('\u{F5DE}')
}
pub fn key_icon() -> Text<'static> {
icon('\u{F44F}')
}
pub fn cross_icon() -> Text<'static> {
icon('\u{F62A}')
bootstrap_icon('\u{F5DE}')
}
pub fn pencil_icon() -> Text<'static> {
icon('\u{F4CB}')
}
#[allow(dead_code)]
pub fn stakeholder_icon() -> Text<'static> {
icon('\u{F4AE}')
}
#[allow(dead_code)]
pub fn manager_icon() -> Text<'static> {
icon('\u{F4B4}')
}
pub fn done_icon() -> Text<'static> {
icon('\u{F26B}')
}
pub fn todo_icon() -> Text<'static> {
icon('\u{F28A}')
bootstrap_icon('\u{F4CB}')
}
pub fn collapse_icon() -> Text<'static> {
icon('\u{F284}')
bootstrap_icon('\u{F284}')
}
pub fn collapsed_icon() -> Text<'static> {
icon('\u{F282}')
bootstrap_icon('\u{F282}')
}
pub fn down_icon() -> Text<'static> {
icon('\u{F279}')
bootstrap_icon('\u{F279}')
}
pub fn up_icon() -> Text<'static> {
icon('\u{F27C}')
bootstrap_icon('\u{F27C}')
}
pub fn people_icon() -> Text<'static> {
icon('\u{F4CF}')
bootstrap_icon('\u{F4CF}')
}
pub fn network_icon() -> Text<'static> {
bootstrap_icon('\u{F40D}')
}
const ICONEX_ICONS: Font = Font::External {
name: "Iconex icons",
bytes: include_bytes!("../static/icons/iconex/iconex-icons.ttf"),
};
fn iconex_icon(unicode: char) -> Text<'static> {
Text::new(unicode.to_string())
.font(ICONEX_ICONS)
.width(Length::Units(20))
.horizontal_alignment(alignment::Horizontal::Center)
.size(20)
}
pub fn arrow_repeat() -> Text<'static> {
iconex_icon('\u{46BB}')
}
pub fn send_icon() -> Text<'static> {
iconex_icon('\u{2CEE}')
}
pub fn receive_icon() -> Text<'static> {
iconex_icon('\u{605B}')
}
pub fn home_icon() -> Text<'static> {
iconex_icon('\u{C722}')
}
pub fn settings_icon() -> Text<'static> {
iconex_icon('\u{3038}')
}
pub fn key_icon() -> Text<'static> {
iconex_icon('\u{FFEC}')
}
pub fn history_icon() -> Text<'static> {
iconex_icon('\u{BEBA}')
}
pub fn coins_icon() -> Text<'static> {
iconex_icon('\u{9F25}')
}
pub fn clock_icon() -> Text<'static> {
iconex_icon('\u{B0CA}')
}
pub fn clipboard_icon() -> Text<'static> {
iconex_icon('\u{F8D3}')
}
pub fn circle_check_icon() -> Text<'static> {
iconex_icon('\u{E2F9}')
}
pub fn circle_cross_icon() -> Text<'static> {
iconex_icon('\u{19DA}')
}

View File

@ -12,27 +12,3 @@ pub fn liana_grey_logo() -> Svg {
let h = Handle::from_memory(LIANA_LOGO_GREY.to_vec());
Svg::new(h)
}
const HISTORY_ICON: &[u8] = include_bytes!("../static/icons/history-icon.svg");
pub fn history_icon() -> Svg {
let h = Handle::from_memory(HISTORY_ICON.to_vec());
Svg::new(h)
}
const COINS_ICON: &[u8] = include_bytes!("../static/icons/coins-icon.svg");
pub fn coins_icon() -> Svg {
let h = Handle::from_memory(COINS_ICON.to_vec());
Svg::new(h)
}
const CLOCK_ICON: &[u8] = include_bytes!("../static/icons/clock-icon.svg");
pub fn clock_icon() -> Svg {
let h = Handle::from_memory(CLOCK_ICON.to_vec());
Svg::new(h)
}
const CLOCK_RED_ICON: &[u8] = include_bytes!("../static/icons/clock-red-icon.svg");
pub fn clock_red_icon() -> Svg {
let h = Handle::from_memory(CLOCK_RED_ICON.to_vec());
Svg::new(h)
}

View File

@ -1,6 +0,0 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="13" r="9" stroke="#717171" stroke-width="1.5"/>
<path d="M10 1H14" stroke="#717171" stroke-width="1.5" stroke-linecap="round"/>
<path d="M12 1L12 4" stroke="#717171" stroke-width="1.5" stroke-linecap="round"/>
<path d="M12 13L15 10" stroke="#717171" stroke-width="1.5" stroke-linecap="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 417 B

View File

@ -1,6 +0,0 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="13" r="9" stroke="#E9431F" stroke-width="1.5"/>
<path d="M10 1H14" stroke="#E9431F" stroke-width="1.5" stroke-linecap="round"/>
<path d="M12 1L12 4" stroke="#E9431F" stroke-width="1.5" stroke-linecap="round"/>
<path d="M12 13L15 10" stroke="#E9431F" stroke-width="1.5" stroke-linecap="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 417 B

View File

@ -1,3 +0,0 @@
<svg width="20" height="23" viewBox="0 0 20 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.7189 9.02728L17.8442 10.177L18.2891 10.4269C19.237 10.9595 19.237 12.3325 18.2891 12.865L12.2525 16.2566C10.8524 17.0432 9.14756 17.0432 7.74754 16.2566L1.71092 12.865C0.763024 12.3325 0.763026 10.9595 1.71093 10.4269L2.15585 10.177L4.16334 9.02728M16.1811 14.1461L18.1129 15.1185C19.1092 15.6201 19.1412 17.0398 18.1685 17.5862L12.2525 20.9101C10.8524 21.6966 9.14756 21.6966 7.74754 20.9101L1.9178 17.6347C0.928395 17.0789 0.982913 15.6278 2.0112 15.1487L4.16334 14.1461M12.2525 11.3112L18.2891 7.91961C19.237 7.38705 19.237 6.01405 18.2891 5.48149L12.2525 2.08993C10.8524 1.30336 9.14756 1.30336 7.74754 2.08993L1.71093 5.48149C0.763027 6.01405 0.763024 7.38705 1.71092 7.91961L7.74754 11.3112C9.14756 12.0977 10.8524 12.0977 12.2525 11.3112Z" stroke="#7A7A7A" stroke-width="1.5"/>
</svg>

Before

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17 2H7C4.23858 2 2 4.23858 2 7V17C2 19.7614 4.23858 22 7 22H17C19.7614 22 22 19.7614 22 17V7C22 4.23858 19.7614 2 17 2Z" stroke="#717171" stroke-width="1.5" stroke-linecap="round"/>
<path d="M12.5858 9L10.2929 11.2929C9.90237 11.6834 9.90237 12.3166 10.2929 12.7071L12.5858 15" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 452 B

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.7232 2.75892C20.6613 2.44621 21.5538 3.3387 21.2411 4.27681L16.1845 19.4466C15.8561 20.4318 14.5163 20.563 14.0029 19.6603L10.9078 14.2171C10.6409 13.7477 10.2522 13.3591 9.78283 13.0922L4.33973 9.99709C3.437 9.48377 3.56824 8.14391 4.55342 7.81552L19.7232 2.75892Z" stroke="#CDCDCD" stroke-width="1.5"/>
<path d="M12.7858 11.2143L10.7858 13.2143" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 549 B

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="2" width="20" height="20" rx="5" stroke="#CDCDCD" stroke-width="1.5"/>
<path d="M9.5 11.5L11.5 13.5L15.5 9.5" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 313 B

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="2" width="20" height="20" rx="5" stroke="#717171" stroke-width="1.5"/>
<path d="M9.87864 14.1215L14.1213 9.87891" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9.87864 9.87894L14.1213 14.1216" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 445 B

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.7189 9.52728L19.8442 10.677L20.2891 10.9269C21.237 11.4595 21.237 12.8325 20.2891 13.365L14.2525 16.7566C12.8524 17.5432 11.1476 17.5432 9.74754 16.7566L3.71092 13.365C2.76302 12.8325 2.76303 11.4595 3.71093 10.9269L4.15585 10.677L6.16334 9.52728M18.1811 14.6461L20.1129 15.6185C21.1092 16.1201 21.1412 17.5398 20.1685 18.0862L14.2525 21.4101C12.8524 22.1966 11.1476 22.1966 9.74754 21.4101L3.9178 18.1347C2.9284 17.5789 2.98291 16.1278 4.0112 15.6487L6.16334 14.6461M14.2525 11.8112L20.2891 8.41961C21.237 7.88705 21.237 6.51405 20.2891 5.98149L14.2525 2.58993C12.8524 1.80336 11.1476 1.80336 9.74754 2.58993L3.71093 5.98149C2.76303 6.51405 2.76302 7.88705 3.71092 8.41961L9.74754 11.8112C11.1476 12.5977 12.8524 12.5977 14.2525 11.8112Z" stroke="#CDCDCD" stroke-width="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 894 B

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="5" y="3" width="10" height="14" rx="3" stroke="#CDCDCD" stroke-width="1.5"/>
<path d="M17.5 7.40137C18.3967 7.92008 19 8.8896 19 10V18C19 19.6569 17.6569 21 16 21H12C10.8896 21 9.92008 20.3967 9.40137 19.5" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 380 B

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5 9L11.2191 14.3306C11.6684 14.7158 12.3316 14.7158 12.7809 14.3306L19 9" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 248 B

View File

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 347 B

View File

@ -0,0 +1,6 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="4" y="4" width="7" height="7" rx="2.5" stroke="#CDCDCD" stroke-width="1.5"/>
<rect x="4" y="14" width="7" height="7" rx="2.5" stroke="#CDCDCD" stroke-width="1.5"/>
<rect x="14" y="4" width="7" height="7" rx="2.5" stroke="#CDCDCD" stroke-width="1.5"/>
<rect x="14" y="14" width="7" height="7" rx="2.5" stroke="#CDCDCD" stroke-width="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 451 B

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 13L11.2929 15.2929C11.6834 15.6834 12.3166 15.6834 12.7071 15.2929L15 13" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
<path d="M12 15L12 3" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
<path d="M22 21L2 21" stroke="#CDCDCD" stroke-width="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 393 B

View File

@ -0,0 +1,7 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="2" width="20" height="20" rx="5" stroke="#717171" stroke-width="1.5"/>
<path d="M17.5 12.5L10.5 12.5" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17.5 10.5L17.5 12.5" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M15 10.5L15 12.5" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="2" cy="2" r="2" transform="matrix(-1 0 0 1 10.5 10.5)" stroke="#CDCDCD" stroke-width="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 638 B

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="2" width="20" height="20" rx="5" stroke="#717171" stroke-width="1.5"/>
<path d="M9 12H15" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12 8.99993L12 14.9999" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 411 B

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 8L6 8C3.79086 8 2 9.79086 2 12L2 17C2 19.2091 3.79086 21 6 21L18 21C20.2091 21 22 19.2091 22 17L22 12C22 9.79086 20.2091 8 18 8L16 8" stroke="#717171" stroke-width="1.5" stroke-linecap="round"/>
<path d="M9 13L11.2929 15.2929C11.6834 15.6834 12.3166 15.6834 12.7071 15.2929L15 13" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
<path d="M12 15L12 3" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 540 B

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.07167 8.0001C5.80935 6.72238 6.88601 5.67355 8.1826 4.96956C9.47919 4.26557 10.9452 3.93385 12.4186 4.01106C13.8919 4.08828 15.3152 4.57142 16.5311 5.40709C17.747 6.24275 18.7081 7.39838 19.3082 8.74621M3.23169 5.51546L3.9611 8.675C4.08534 9.21313 4.62229 9.54866 5.16042 9.42443L8.31996 8.69501M18.9281 16C18.1904 17.2777 17.1138 18.3265 15.8172 19.0305C14.5206 19.7345 13.0546 20.0662 11.5812 19.989C10.1079 19.9118 8.68456 19.4287 7.46866 18.593C6.25276 17.7573 5.29164 16.6017 4.69155 15.2539M20.7681 18.4846L20.0387 15.3251C19.9144 14.787 19.3775 14.4514 18.8394 14.5757L15.6798 15.3051" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 769 B

View File

@ -0,0 +1,6 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="13" r="9" stroke="#CDCDCD" stroke-width="1.5"/>
<path d="M10 1H14" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
<path d="M12 1L12 4" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
<path d="M12 13L15 10" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 417 B

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 6C2 3.79086 3.79086 2 6 2H12H14.7574C15.553 2 16.3161 2.31607 16.8787 2.87868L21.1213 7.12132C21.6839 7.68393 22 8.44699 22 9.24264V12V18C22 20.2091 20.2091 22 18 22H6C3.79086 22 2 20.2091 2 18V6Z" stroke="#CDCDCD" stroke-width="1.5"/>
<path d="M6 15C6 13.8954 6.89543 13 8 13H16C17.1046 13 18 13.8954 18 15V22H6V15Z" stroke="#CDCDCD" stroke-width="1.5"/>
<path d="M8 2V6C8 6.55228 8.44772 7 9 7H15C15.5523 7 16 6.55228 16 6V2" stroke="#CDCDCD" stroke-width="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 581 B

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16 8L18 8C20.2091 8 22 9.79086 22 12L22 17C22 19.2091 20.2091 21 18 21L17 21L12 21L7 21L6 21C3.79086 21 2 19.2091 2 17L2 12C2 9.79086 3.79086 8 6 8L8 8" stroke="#717171" stroke-width="1.5" stroke-linecap="round"/>
<path d="M15 5L12.7071 2.70711C12.3166 2.31658 11.6834 2.31658 11.2929 2.70711L9 5" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
<path d="M12 3L12 15" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 555 B

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="10" stroke="#717171" stroke-width="1.5"/>
<path d="M12 8V11.7324C12 11.8996 12.0836 12.0557 12.2226 12.1484L15 14" stroke="#CDCDCD" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 306 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -0,0 +1,33 @@
import sys
import os
import fontforge
def generate_glyph_code(filename):
glyph_code = hash(filename) % 0xFFFF
# Avoid surrogate range (0xD800-0xDFFF)
if 0xD800 <= glyph_code <= 0xDFFF:
glyph_code += 0x800
return glyph_code
input_folder = sys.argv[1]
output_font_file = sys.argv[2]
font = fontforge.font()
font.encoding = 'UnicodeFull'
for svg_file in os.listdir(input_folder):
if not svg_file.endswith('.svg'):
continue
glyph_name = os.path.splitext(svg_file)[0]
glyph_code = generate_glyph_code(glyph_name)
glyph = font.createChar(glyph_code)
glyph.importOutlines(os.path.join(input_folder, svg_file))
glyph.simplify()
font.generate(output_font_file)