iced_core::text

Trait 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,
    );
}
Expand description

A renderer capable of measuring and drawing Text.

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 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 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Renderer for ()

Source§

const ICON_FONT: Font = Font::DEFAULT

Source§

const CHECKMARK_ICON: char = '0'

Source§

const ARROW_DOWN_ICON: char = '0'

Source§

type Font = Font

Source§

type Paragraph = ()

Source§

type Editor = ()

Source§

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

Source§

fn default_size(&self) -> Pixels

Source§

fn fill_paragraph( &mut self, _paragraph: &Self::Paragraph, _position: Point, _color: Color, _clip_bounds: Rectangle, )

Source§

fn fill_editor( &mut self, _editor: &Self::Editor, _position: Point, _color: Color, _clip_bounds: Rectangle, )

Source§

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

Implementors§