diff options
author | 2024-04-16 00:08:17 +0900 | |
---|---|---|
committer | 2024-04-16 00:08:17 +0900 | |
commit | 0ebe0629cef37aee5c48b9409fc36618a3a3e60d (patch) | |
tree | 909d9ecf28e7c491bae3afc81928c118517fa7a9 /core/src/text.rs | |
parent | 13bd106fc585034a7aba17b9c17589113274aaf5 (diff) | |
parent | 105b8bd5ad6ade1f203a0d8b0b93bd06f61f621a (diff) | |
download | iced-0ebe0629cef37aee5c48b9409fc36618a3a3e60d.tar.gz iced-0ebe0629cef37aee5c48b9409fc36618a3a3e60d.tar.bz2 iced-0ebe0629cef37aee5c48b9409fc36618a3a3e60d.zip |
Merge branch 'iced-rs:master' into viewer_content_fit
Diffstat (limited to 'core/src/text.rs')
-rw-r--r-- | core/src/text.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/src/text.rs b/core/src/text.rs index edef79c2..b30feae0 100644 --- a/core/src/text.rs +++ b/core/src/text.rs @@ -11,14 +11,13 @@ pub use paragraph::Paragraph; use crate::alignment; use crate::{Color, Pixels, Point, Rectangle, Size}; -use std::borrow::Cow; use std::hash::{Hash, Hasher}; /// A paragraph. #[derive(Debug, Clone, Copy)] -pub struct Text<'a, Font> { +pub struct Text<Content = String, Font = crate::Font> { /// The content of the paragraph. - pub content: &'a str, + pub content: Content, /// The bounds of the paragraph. pub bounds: Size, @@ -192,9 +191,6 @@ pub trait Renderer: crate::Renderer { /// Returns the default size of [`Text`]. fn default_size(&self) -> Pixels; - /// Loads a [`Self::Font`] from its bytes. - fn load_font(&mut self, font: Cow<'static, [u8]>); - /// Draws the given [`Paragraph`] at the given position and with the given /// [`Color`]. fn fill_paragraph( @@ -219,7 +215,7 @@ pub trait Renderer: crate::Renderer { /// [`Color`]. fn fill_text( &mut self, - text: Text<'_, Self::Font>, + text: Text<String, Self::Font>, position: Point, color: Color, clip_bounds: Rectangle, |