summaryrefslogtreecommitdiffstats
path: root/graphics/src/renderer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-04 11:12:15 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-24 13:29:11 +0100
commit238154af4ac8dda7f12dd90aa7be106e933bcb30 (patch)
tree4c8560b3464f0c900ddf31a3c063e925394923c6 /graphics/src/renderer.rs
parentb29de28d1f0f608f8029c93d154cfd1b0f8b8cbb (diff)
downloadiced-238154af4ac8dda7f12dd90aa7be106e933bcb30.tar.gz
iced-238154af4ac8dda7f12dd90aa7be106e933bcb30.tar.bz2
iced-238154af4ac8dda7f12dd90aa7be106e933bcb30.zip
Implement `font::load` command in `iced_native`
Diffstat (limited to 'graphics/src/renderer.rs')
-rw-r--r--graphics/src/renderer.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/graphics/src/renderer.rs b/graphics/src/renderer.rs
index 7ad53dec..b052c094 100644
--- a/graphics/src/renderer.rs
+++ b/graphics/src/renderer.rs
@@ -10,6 +10,7 @@ use iced_native::{Background, Color, Element, Font, Point, Rectangle, Size};
pub use iced_native::renderer::Style;
+use std::borrow::Cow;
use std::marker::PhantomData;
/// A backend-agnostic renderer that supports all the built-in widgets.
@@ -167,6 +168,10 @@ where
)
}
+ fn load_font(&mut self, bytes: Cow<'static, [u8]>) {
+ self.backend.load_font(bytes);
+ }
+
fn fill_text(&mut self, text: Text<'_, Self::Font>) {
self.primitives.push(Primitive::Text {
content: text.content.to_string(),