#字体 #嵌入式图形 #等宽字体 #图形 #pico-8

不依赖 std embedded-picofont

与嵌入式图形一起使用的PICO-8字体

4个版本

0.2.1 2020年11月27日
0.2.0 2020年4月18日
0.1.1 2019年10月30日
0.1.0 2019年7月3日

#6 in #等宽字体

MIT 许可协议

38KB
80 代码行

embedded-picofont Star me

embedded-graphics一起使用的PICO-8字体。

TravisCI Codecov License Source Crate Documentation Changelog GitHub issues

概述

此包提供了PICO-8幻想控制台的超小4x6字体,作为embedded_graphics::fonts::Font

Font

请注意,PICO-8本身仅使用大写字母,因为如果显示器未放大,则小写字母可能难以阅读。因此,建议仅使用此字体来显示大写字母。

用法

使用TextStyle将PICO-8字体附加到文本

use embedded_picofont::FontPico;
let text = Text::new("Hello world!", Point::new(0, 0))
    .into_styled(TextStyle::new(FontPico, Gray8::WHITE));

Hello world

PICO-8还有宽字符:这些字符可以使用128到255的字符范围内的两个较小字符显示

use embedded_picofont::{text_pico, FontPico};
let text = Text::new("PRESS \u{96}\u{97} TO GO BACK", Point::new(0, 0))
    .into_styled(TextStyle::new(FontPico, Gray8::WHITE));

Press left to go back

有关如何使用此包的更多信息,请参阅embedded-graphics 文档

许可协议

依赖项

~3MB
~25K SLoC