cosmic::iced_renderer::graphics::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;
    type Raw;

    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_raw(&mut self, raw: Self::Raw);
    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.

source

type Raw

The Raw 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_raw(&mut self, raw: Self::Raw)

Draws the given Raw

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 ()

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§

type Raw = ()

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_raw(&mut self, _raw: <() as Renderer>::Raw)

source§

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

source§

impl Renderer for Renderer

source§

const ICON_FONT: Font = _

source§

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

source§

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

source§

type Font = Font

source§

type Paragraph = Paragraph

source§

type Editor = Editor

source§

type Raw = Raw

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§

fn fill_raw(&mut self, raw: <Renderer as Renderer>::Raw)

Implementors§

source§

impl<A, B> Renderer for cosmic::iced_widget::renderer::fallback::Renderer<A, B>
where A: Renderer, B: Renderer<Font = <A as Renderer>::Font, Paragraph = <A as Renderer>::Paragraph, Editor = <A as Renderer>::Editor, Raw = <A as Renderer>::Raw>,

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§

type Font = <A as Renderer>::Font

source§

type Paragraph = <A as Renderer>::Paragraph

source§

type Editor = <A as Renderer>::Editor

source§

type Raw = <A as Renderer>::Raw