Trait iced::advanced::text::Renderer

source ·
pub trait Renderer: Renderer {
    type Font: Copy + PartialEq;
    type Paragraph: Paragraph<Font = Self::Font> + 'static;
    type Editor: Editor<Font = Self::Font> + 'static;

    const ICON_FONT: Self::Font;
    const CHECKMARK_ICON: char;
    const ARROW_DOWN_ICON: char;

    // Required methods
    fn default_font(&self) -> Self::Font;
    fn default_size(&self) -> Pixels;
    fn fill_paragraph(
        &mut self,
        text: &Self::Paragraph,
        position: Point,
        color: Color,
        clip_bounds: Rectangle
    );
    fn fill_editor(
        &mut self,
        editor: &Self::Editor,
        position: Point,
        color: Color,
        clip_bounds: Rectangle
    );
    fn fill_text(
        &mut self,
        text: Text<String, Self::Font>,
        position: Point,
        color: Color,
        clip_bounds: Rectangle
    );
}
Available on crate feature advanced only.
Expand description

A renderer capable of measuring and drawing Text.

Required Associated Types§

source

type Font: Copy + PartialEq

The font type used.

source

type Paragraph: Paragraph<Font = Self::Font> + 'static

The Paragraph of this Renderer.

source

type Editor: Editor<Font = Self::Font> + 'static

The Editor of this Renderer.

Required Associated Constants§

source

const ICON_FONT: Self::Font

The icon font of the backend.

source

const CHECKMARK_ICON: char

The char representing a ✔ icon in the ICON_FONT.

source

const ARROW_DOWN_ICON: char

The char representing a ▼ icon in the built-in ICON_FONT.

Required Methods§

source

fn default_font(&self) -> Self::Font

Returns the default Self::Font.

source

fn default_size(&self) -> Pixels

Returns the default size of Text.

source

fn fill_paragraph( &mut self, text: &Self::Paragraph, position: Point, color: Color, clip_bounds: Rectangle )

Draws the given Paragraph at the given position and with the given Color.

source

fn fill_editor( &mut self, editor: &Self::Editor, position: Point, color: Color, clip_bounds: Rectangle )

Draws the given Editor at the given position and with the given Color.

source

fn fill_text( &mut self, text: Text<String, Self::Font>, position: Point, color: Color, clip_bounds: Rectangle )

Draws the given Text at the given position and with the given Color.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Renderer for ()

§

type Font = Font

§

type Paragraph = ()

§

type Editor = ()

source§

const ICON_FONT: Font = Font::DEFAULT

source§

const CHECKMARK_ICON: char = '0'

source§

const ARROW_DOWN_ICON: char = '0'

source§

fn default_font(&self) -> <() as Renderer>::Font

source§

fn default_size(&self) -> Pixels

source§

fn fill_paragraph( &mut self, _paragraph: &<() as Renderer>::Paragraph, _position: Point, _color: Color, _clip_bounds: Rectangle )

source§

fn fill_editor( &mut self, _editor: &<() as Renderer>::Editor, _position: Point, _color: Color, _clip_bounds: Rectangle )

source§

fn fill_text( &mut self, _paragraph: Text, _position: Point, _color: Color, _clip_bounds: Rectangle )

source§

impl Renderer for Renderer

§

type Font = Font

§

type Paragraph = Paragraph

§

type Editor = Editor

source§

const ICON_FONT: Font = _

source§

const CHECKMARK_ICON: char = '\u{f00c}'

source§

const ARROW_DOWN_ICON: char = '\u{e800}'

source§

fn default_font(&self) -> <Renderer as Renderer>::Font

source§

fn default_size(&self) -> Pixels

source§

fn fill_paragraph( &mut self, text: &<Renderer as Renderer>::Paragraph, position: Point, color: Color, clip_bounds: Rectangle )

source§

fn fill_editor( &mut self, editor: &<Renderer as Renderer>::Editor, position: Point, color: Color, clip_bounds: Rectangle )

source§

fn fill_text( &mut self, text: Text, position: Point, color: Color, clip_bounds: Rectangle )

source§

impl Renderer for Renderer

§

type Font = Font

§

type Paragraph = Paragraph

§

type Editor = Editor

source§

const ICON_FONT: Font = _

source§

const CHECKMARK_ICON: char = '\u{f00c}'

source§

const ARROW_DOWN_ICON: char = '\u{e800}'

source§

fn default_font(&self) -> <Renderer as Renderer>::Font

source§

fn default_size(&self) -> Pixels

source§

fn fill_paragraph( &mut self, text: &<Renderer as Renderer>::Paragraph, position: Point, color: Color, clip_bounds: Rectangle )

source§

fn fill_editor( &mut self, editor: &<Renderer as Renderer>::Editor, position: Point, color: Color, clip_bounds: Rectangle )

source§

fn fill_text( &mut self, text: Text, position: Point, color: Color, clip_bounds: Rectangle )

source§

impl<A, B> Renderer for Renderer<A, B>
where B: Renderer<Font = <A as Renderer>::Font, Paragraph = <A as Renderer>::Paragraph, Editor = <A as Renderer>::Editor>, A: Renderer,

§

type Font = <A as Renderer>::Font

§

type Paragraph = <A as Renderer>::Paragraph

§

type Editor = <A as Renderer>::Editor

source§

const ICON_FONT: <Renderer<A, B> as Renderer>::Font = A::ICON_FONT

source§

const CHECKMARK_ICON: char = A::CHECKMARK_ICON

source§

const ARROW_DOWN_ICON: char = A::ARROW_DOWN_ICON

source§

fn default_font(&self) -> <Renderer<A, B> as Renderer>::Font

source§

fn default_size(&self) -> Pixels

source§

fn fill_paragraph( &mut self, text: &<Renderer<A, B> as Renderer>::Paragraph, position: Point, color: Color, clip_bounds: Rectangle )

source§

fn fill_editor( &mut self, editor: &<Renderer<A, B> as Renderer>::Editor, position: Point, color: Color, clip_bounds: Rectangle )

source§

fn fill_text( &mut self, text: Text<String, <Renderer<A, B> as Renderer>::Font>, position: Point, color: Color, clip_bounds: Rectangle )

Implementors§