iced-yoda/graphics/src/font.rs

36 lines
1.2 KiB
Rust
Raw Normal View History

//! Find system fonts or use the built-in ones.
2020-05-19 20:20:51 +02:00
#[cfg(feature = "font-source")]
mod source;
#[cfg(feature = "font-source")]
#[cfg_attr(docsrs, doc(cfg(feature = "font-source")))]
2020-05-19 20:20:51 +02:00
pub use source::Source;
#[cfg(feature = "font-source")]
#[cfg_attr(docsrs, doc(cfg(feature = "font-source")))]
2020-05-19 20:20:51 +02:00
pub use font_kit::{
error::SelectionError as LoadError, family_name::FamilyName as Family,
};
2020-05-19 20:30:46 +02:00
/// A built-in fallback font, for convenience.
2020-05-19 20:30:46 +02:00
#[cfg(feature = "font-fallback")]
#[cfg_attr(docsrs, doc(cfg(feature = "font-fallback")))]
2020-05-19 20:30:46 +02:00
pub const FALLBACK: &[u8] = include_bytes!("../fonts/Lato-Regular.ttf");
/// A built-in icon font, for convenience.
2020-05-19 20:30:46 +02:00
#[cfg(feature = "font-icons")]
#[cfg_attr(docsrs, doc(cfg(feature = "font-icons")))]
2020-05-19 20:30:46 +02:00
pub const ICONS: iced_native::Font = iced_native::Font::External {
name: "iced_wgpu icons",
bytes: include_bytes!("../fonts/Icons.ttf"),
};
/// The `char` representing a ✔ icon in the built-in [`ICONS`] font.
2020-05-19 20:30:46 +02:00
#[cfg(feature = "font-icons")]
#[cfg_attr(docsrs, doc(cfg(feature = "font-icons")))]
2020-05-19 20:30:46 +02:00
pub const CHECKMARK_ICON: char = '\u{F00C}';
2020-04-18 19:53:27 +02:00
/// The `char` representing a ▼ icon in the built-in [`ICONS`] font.
#[cfg(feature = "font-icons")]
pub const ARROW_DOWN_ICON: char = '\u{E800}';