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 #等宽字体
38KB
80 代码行
embedded-picofont

与embedded-graphics
一起使用的PICO-8字体。
概述
此包提供了PICO-8幻想控制台的超小4x6字体,作为embedded_graphics::fonts::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));
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));
有关如何使用此包的更多信息,请参阅embedded-graphics
文档
许可协议
依赖项
~3MB
~25K SLoC