[][src]Trait embedded_graphics::fonts::Font

pub trait Font<'a, C>: WithStyle<C> + Dimensions where
    C: PixelColor
{ fn render_str(chars: &'a str) -> Self; }

Common methods for all fonts

Required methods

fn render_str(chars: &'a str) -> Self

Render a string in the implementing font's typeface.

Defaults to 1u8 for stroke_color and 0u8 for fill_color

use embedded_graphics::prelude::*;
use embedded_graphics::fonts::Font6x8;
use embedded_graphics::pixelcolor::Rgb565;

fn main() {
    let mut disp = Display::default();
    // Render a string with a red stroke
    let text = Font6x8::render_str("Hello world")
        .style(Style::stroke(Rgb565::RED));

    disp.draw(text);
}
Loading content...

Implementors

impl<'a, C, Conf> Font<'a, C> for FontBuilder<'a, C, Conf> where
    C: PixelColor,
    Conf: FontBuilderConf
[src]

Loading content...