summaryrefslogtreecommitdiffstats
path: root/native/src/font.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/font.rs')
-rw-r--r--native/src/font.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/native/src/font.rs b/native/src/font.rs
new file mode 100644
index 00000000..6840a25f
--- /dev/null
+++ b/native/src/font.rs
@@ -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),
+ })
+}