summaryrefslogtreecommitdiffstats
path: root/graphics/src/backend.rs
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/src/backend.rs')
-rw-r--r--graphics/src/backend.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/graphics/src/backend.rs b/graphics/src/backend.rs
index 256b7ab5..dd2888ab 100644
--- a/graphics/src/backend.rs
+++ b/graphics/src/backend.rs
@@ -1,8 +1,10 @@
//! Write a graphics backend.
-use iced_native::image;
-use iced_native::svg;
-use iced_native::text;
-use iced_native::{Font, Point, Size};
+use iced_core::image;
+use iced_core::svg;
+use iced_core::text;
+use iced_core::{Font, Point, Size};
+
+use std::borrow::Cow;
/// The graphics backend of a [`Renderer`].
///
@@ -31,6 +33,9 @@ pub trait Text {
/// [`ICON_FONT`]: Self::ICON_FONT
const ARROW_DOWN_ICON: char;
+ /// Returns the default [`Font`].
+ fn default_font(&self) -> Font;
+
/// Returns the default size of text.
fn default_size(&self) -> f32;
@@ -61,6 +66,9 @@ pub trait Text {
point: Point,
nearest_only: bool,
) -> Option<text::Hit>;
+
+ /// Loads a [`Font`] from its bytes.
+ fn load_font(&mut self, font: Cow<'static, [u8]>);
}
/// A graphics backend that supports image rendering.