iced_runtime/font.rs
1//! Load and use fonts.
2use crate::Action;
3use crate::task::{self, Task};
4use std::borrow::Cow;
5
6/// An error while loading a font.
7#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8pub enum Error {}
9
10/// Load a font from its bytes.
11pub fn load(bytes: impl Into<Cow<'static, [u8]>>) -> Task<Result<(), Error>> {
12 task::oneshot(|channel| Action::LoadFont {
13 bytes: bytes.into(),
14 channel,
15 })
16}