#font #embedded-graphics #mono-font

no-std multi-mono-font

Multi mono font mixed typesetting for embedded-graphics

2 releases

new 0.1.1 Sep 6, 2024
0.1.0 Sep 4, 2024

#430 in Embedded development

Download history 262/week @ 2024-09-02

262 downloads per month

MIT license

740KB
900 lines

Multi mono font

Introduction

Multi mono font mixed typesetting for embedded-graphics

This crate is modified based on embedded-graphics MonoFonts to add support for displaying different sizes of monospaced fonts within the same line/segment of text.

The strikethrough and underline have been removed from the original fonts, and some variable types have been changed to u8 (can be changed to u16 via features) to save storage space.

Check examples/hello.rs for usage.

const MULTI_STYLE: MultiMonoTextStyle<Rgb565> = MultiMonoTextStyle::new(
    &[&UPPER_FONT, &HZ_FONT, &LOWER_FONT],
    MultiMonoLineHeight::Max,
    Rgb565::WHITE,
);

let _next = Text::new("测HElLo试OK\n", Point::new(0, 32), MULTI_STYLE)
	.draw(&mut disp)
	.unwrap();
let _next = Text::new("字WoRlD体ok", _next, MULTI_STYLE)
	.draw(&mut disp)
	.unwrap();

hello_img

Dependencies

~3MB
~35K SLoC