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 load_font(&mut self, font: Cow<'static, [u8]>);
    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<'_, 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 load_font(&mut self, font: Cow<'static, [u8]>)

Loads a Self::Font from its bytes.

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<'_, 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§

§

impl<B> Renderer for Renderer<B>
where B: Backend + Text,

§

type Font = Font

§

type Paragraph = Paragraph

§

type Editor = Editor

§

const ICON_FONT: Font = _

§

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

§

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

§

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

§

fn default_size(&self) -> Pixels

§

fn load_font(&mut self, bytes: Cow<'static, [u8]>)

§

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

§

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

§

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

Implementors§

source§

impl Renderer for iced::Renderer

§

type Font = Font

§

type Paragraph = Paragraph

§

type Editor = Editor

source§

const ICON_FONT: Font = iced_tiny_skia::Renderer::ICON_FONT

source§

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

source§

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

source§

impl Renderer for Null

§

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'