Implement font::load command in iced_native
This commit is contained in:
parent
b29de28d1f
commit
238154af4a
14 changed files with 384 additions and 241 deletions
19
native/src/font.rs
Normal file
19
native/src/font.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//! Load and use fonts.
|
||||
pub use iced_core::Font;
|
||||
|
||||
use crate::command::{self, Command};
|
||||
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]>>,
|
||||
) -> Command<Result<(), Error>> {
|
||||
Command::single(command::Action::LoadFont {
|
||||
bytes: bytes.into(),
|
||||
tagger: Box::new(std::convert::identity),
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue