iced-yoda/runtime/src/font.rs
2024-06-14 01:47:39 +02:00

15 lines
386 B
Rust

//! Load and use fonts.
use crate::{Action, Task};
use std::borrow::Cow;
/// An error while loading a font.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Error {}
/// Load a font from its bytes.
pub fn load(bytes: impl Into<Cow<'static, [u8]>>) -> Task<Result<(), Error>> {
Task::oneshot(|channel| Action::LoadFont {
bytes: bytes.into(),
channel,
})
}