diff options
author | 2020-04-23 22:17:11 +0200 | |
---|---|---|
committer | 2020-04-23 22:17:11 +0200 | |
commit | 0300b649d7f99bd63494a9672e3a295bca7ec5d7 (patch) | |
tree | 5c8371294c946bf3cf453aa9c04fd4937031e71b /wgpu | |
parent | 6786b8a3aaf87bd9875b2253ac0986f050cc8445 (diff) | |
download | iced-0300b649d7f99bd63494a9672e3a295bca7ec5d7.tar.gz iced-0300b649d7f99bd63494a9672e3a295bca7ec5d7.tar.bz2 iced-0300b649d7f99bd63494a9672e3a295bca7ec5d7.zip |
Make `Font` an associated type of `text::Renderer`
Diffstat (limited to 'wgpu')
-rw-r--r-- | wgpu/src/renderer/widget/text.rs | 2 | ||||
-rw-r--r-- | wgpu/src/widget.rs | 4 | ||||
-rw-r--r-- | wgpu/src/widget/text.rs | 7 |
3 files changed, 13 insertions, 0 deletions
diff --git a/wgpu/src/renderer/widget/text.rs b/wgpu/src/renderer/widget/text.rs index 80bff574..f27cc430 100644 --- a/wgpu/src/renderer/widget/text.rs +++ b/wgpu/src/renderer/widget/text.rs @@ -7,6 +7,8 @@ use iced_native::{ use std::f32; impl text::Renderer for Renderer { + type Font = Font; + const DEFAULT_SIZE: u16 = 20; fn measure( diff --git a/wgpu/src/widget.rs b/wgpu/src/widget.rs index c3a47dff..32ccad17 100644 --- a/wgpu/src/widget.rs +++ b/wgpu/src/widget.rs @@ -17,6 +17,8 @@ pub mod scrollable; pub mod slider; pub mod text_input; +mod text; + #[doc(no_inline)] pub use button::Button; #[doc(no_inline)] @@ -36,6 +38,8 @@ pub use slider::Slider; #[doc(no_inline)] pub use text_input::TextInput; +pub use text::Text; + #[cfg(feature = "canvas")] #[cfg_attr(docsrs, doc(cfg(feature = "canvas")))] pub mod canvas; diff --git a/wgpu/src/widget/text.rs b/wgpu/src/widget/text.rs new file mode 100644 index 00000000..1053ea97 --- /dev/null +++ b/wgpu/src/widget/text.rs @@ -0,0 +1,7 @@ +//! Write some text for your users to read. +use crate::Renderer; + +/// A paragraph of text. +/// +/// This is an alias of an `iced_native` text with an `iced_wgpu::Renderer`. +pub type Text = iced_native::Text<Renderer>; |