iced_fonts/
lib.rs

1#[allow(unused_imports)]
2use iced_core::Font;
3pub use iced_fonts_macros::{generate_icon_advanced_functions, generate_icon_functions};
4
5#[cfg(feature = "bootstrap")]
6/// The default icon font bytes for loading the font into iced.
7pub const BOOTSTRAP_FONT_BYTES: &[u8] = include_bytes!("../fonts/bootstrap.ttf");
8#[cfg(feature = "bootstrap")]
9/// The lucide icon font.
10pub const BOOTSTRAP_FONT: Font = Font::with_name("bootstrap-icons");
11#[cfg(feature = "bootstrap")]
12generate_icon_functions!(
13    "fonts/bootstrap.ttf",
14    bootstrap,
15    BOOTSTRAP_FONT,
16    "https://icons.getbootstrap.com/icons",
17);
18
19#[cfg(feature = "codicon")]
20/// The default icon font bytes for loading the font into iced.
21pub const CODICON_FONT_BYTES: &[u8] = include_bytes!("../fonts/codicon.ttf");
22#[cfg(feature = "codicon")]
23/// The codicon font.
24pub const CODICON_FONT: Font = Font::with_name("codicon");
25#[cfg(feature = "codicon")]
26generate_icon_functions!("fonts/codicon.ttf", codicon, CODICON_FONT);
27
28#[cfg(feature = "devicon")]
29/// The default icon font bytes for loading the font into iced.
30pub const DEVICON_FONT_BYTES: &[u8] = include_bytes!("../fonts/devicons.otf");
31#[cfg(feature = "devicon")]
32/// The devicon icon font.
33pub const DEVICON_FONT: Font = Font::with_name("Devicons-NerdFont-Regular");
34#[cfg(feature = "devicon")]
35generate_icon_advanced_functions!("fonts/devicons.otf", devicon, DEVICON_FONT);
36
37#[cfg(feature = "fontawesome")]
38/// The default icon font bytes for loading the font into iced.
39pub const FONTAWESOME_FONT_BYTES: &[u8] = include_bytes!("../fonts/FontAwesome.otf");
40#[cfg(feature = "fontawesome")]
41/// The fontawesome icon font.
42pub const FONTAWESOME_FONT: Font = Font::with_name("FA-NerdFont-Regular");
43#[cfg(feature = "fontawesome")]
44generate_icon_advanced_functions!("fonts/FontAwesome.otf", fontawesome, FONTAWESOME_FONT,);
45
46#[cfg(feature = "lucide")]
47/// The default icon font bytes for loading the font into iced.
48pub const LUCIDE_FONT_BYTES: &[u8] = include_bytes!("../fonts/lucide.ttf");
49#[cfg(feature = "lucide")]
50/// The lucide icon font.
51pub const LUCIDE_FONT: Font = Font::with_name("lucide");
52#[cfg(feature = "lucide")]
53generate_icon_functions!(
54    "fonts/lucide.ttf",
55    lucide,
56    LUCIDE_FONT,
57    "https://lucide.dev/icons"
58);
59
60#[cfg(feature = "nerd")]
61/// The default icon font bytes for loading the font into iced.
62pub const NERD_FONT_BYTES: &[u8] = include_bytes!("../fonts/nerd.ttf");
63#[cfg(feature = "nerd")]
64/// The nerd icon font.
65pub const NERD_FONT: Font = Font::with_name("Symbols Nerd Font Mono");
66#[cfg(feature = "nerd")]
67generate_icon_functions!("fonts/nerd.ttf", nerd, NERD_FONT);
68
69#[cfg(feature = "octicons")]
70/// The default icon font bytes for loading the font into iced.
71pub const OCTICONS_FONT_BYTES: &[u8] = include_bytes!("../fonts/octicons.otf");
72#[cfg(feature = "octicons")]
73/// The octicon icon font.
74pub const OCTICONS_FONT: Font = Font::with_name("OcticonsNerdFont-Regular");
75#[cfg(feature = "octicons")]
76generate_icon_advanced_functions!("fonts/octicons.otf", octicons, OCTICONS_FONT);
77
78#[cfg(feature = "pomicons")]
79/// The default icon font bytes for loading the font into iced.
80pub const POMICONS_FONT_BYTES: &[u8] = include_bytes!("../fonts/pomicons.otf");
81#[cfg(feature = "pomicons")]
82/// The pomicon icon font.
83pub const POMICONS_FONT: Font = Font::with_name("Pomicons");
84#[cfg(feature = "pomicons")]
85generate_icon_functions!("fonts/pomicons.otf", pomicons, POMICONS_FONT);