iced-yoda/runtime/src/font.rs

17 lines
409 B
Rust
Raw Normal View History

//! Load and use fonts.
2024-07-05 01:13:28 +02:00
use crate::Action;
2025-02-21 01:22:56 +01:00
use crate::task::{self, 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>> {
2024-07-05 01:13:28 +02:00
task::oneshot(|channel| Action::LoadFont {
bytes: bytes.into(),
channel,
})
}