pub trait IcedExt {
// Required methods
fn iced_font() -> Font;
fn into_text<'a, Theme>(
self,
font_size: impl Into<Pixels>,
) -> Text<'a, Theme>
where Theme: Catalog;
}Available on crate feature
iced only.Expand description
Extension trait for using these icons from within iced
NerdFont::FONT_BYTESis the raw bytes of the font, for loading into icedNerdFontalso implementsInto<iced::Element>, which will use the default font size
use nerd_font::{IcedExt, categories::Dev};
// A text widget configured to use the icon font, with the selected glyph, and a font size of 24
let text_widget = Dev::Android.into_text(24);You will additionally need to load the font, by calling .font(NerdFont::FONT_BYTES) on your iced::Application.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.