Make Font an associated type of text::Renderer
This commit is contained in:
parent
6786b8a3aa
commit
0300b649d7
9 changed files with 45 additions and 23 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
7
wgpu/src/widget/text.rs
Normal file
7
wgpu/src/widget/text.rs
Normal file
|
|
@ -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>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue