summaryrefslogtreecommitdiffstats
path: root/native/src/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-04 07:33:33 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-24 13:28:24 +0100
commitb29de28d1f0f608f8029c93d154cfd1b0f8b8cbb (patch)
treee100af1dd98d23b29046bc951b04b440d2aa5bc2 /native/src/text.rs
parenta7580e0696a1a0ba76a89db3f78bc99ba3fbb361 (diff)
downloadiced-b29de28d1f0f608f8029c93d154cfd1b0f8b8cbb.tar.gz
iced-b29de28d1f0f608f8029c93d154cfd1b0f8b8cbb.tar.bz2
iced-b29de28d1f0f608f8029c93d154cfd1b0f8b8cbb.zip
Overhaul `Font` type to allow font family selection
Diffstat (limited to 'native/src/text.rs')
-rw-r--r--native/src/text.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/native/src/text.rs b/native/src/text.rs
index 55c3cfd3..b7915a55 100644
--- a/native/src/text.rs
+++ b/native/src/text.rs
@@ -57,7 +57,7 @@ impl Hit {
/// A renderer capable of measuring and drawing [`Text`].
pub trait Renderer: crate::Renderer {
/// The font type used.
- type Font: Default + Clone;
+ type Font: Copy;
/// The icon font of the backend.
const ICON_FONT: Self::Font;
@@ -72,6 +72,9 @@ pub trait Renderer: crate::Renderer {
/// [`ICON_FONT`]: Self::ICON_FONT
const ARROW_DOWN_ICON: char;
+ /// Returns the default [`Font`].
+ fn default_font(&self) -> Self::Font;
+
/// Returns the default size of [`Text`].
fn default_size(&self) -> f32;