Compare commits
2 Commits
958d18b9a8
...
596de6525f
Author | SHA1 | Date | |
---|---|---|---|
596de6525f | |||
9175b9d4cc |
pico-st7789/src
@ -8,24 +8,47 @@
|
||||
// e c
|
||||
// d d d
|
||||
|
||||
pub struct RGB { pub r: u8, pub g: u8, pub b: u8 }
|
||||
use crate::font::{Font, Glyph};
|
||||
|
||||
pub struct RGB {
|
||||
pub r: u8,
|
||||
pub g: u8,
|
||||
pub b: u8,
|
||||
}
|
||||
|
||||
pub trait Canvas {
|
||||
fn set_pixel(&mut self, x: usize, y: usize, color: &RGB);
|
||||
|
||||
fn square(&mut self, x1: usize, y1: usize, x2: usize, y2: usize, color: &RGB) {
|
||||
for x in x1..x2+1 {
|
||||
for x in x1..x2 + 1 {
|
||||
self.set_pixel(x, y1, color);
|
||||
}
|
||||
for x in x1..x2+1 {
|
||||
for x in x1..x2 + 1 {
|
||||
self.set_pixel(x, y2, color);
|
||||
}
|
||||
for y in y1..y2+1 {
|
||||
for y in y1..y2 + 1 {
|
||||
self.set_pixel(x1, y, color);
|
||||
}
|
||||
for y in y1..y2+1 {
|
||||
for y in y1..y2 + 1 {
|
||||
self.set_pixel(x2, y, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn print<A>(
|
||||
canvas: &mut impl Canvas,
|
||||
font: &impl Font<A>,
|
||||
sx: usize,
|
||||
sy: usize,
|
||||
text: &str,
|
||||
color: &RGB,
|
||||
) where
|
||||
A: Glyph,
|
||||
{
|
||||
let mut x = sx;
|
||||
for c in text.chars().map(|c| font.glyph(c)) {
|
||||
c.draw(canvas, x, sy, color);
|
||||
let (dx, _) = c.extents();
|
||||
x = x + dx + 1;
|
||||
}
|
||||
}
|
||||
|
180
pico-st7789/src/font/bits_5_8.rs
Normal file
180
pico-st7789/src/font/bits_5_8.rs
Normal file
@ -0,0 +1,180 @@
|
||||
use alloc::collections::btree_map::BTreeMap;
|
||||
|
||||
use crate::canvas::{Canvas, RGB};
|
||||
|
||||
use super::{Font, Glyph};
|
||||
|
||||
pub struct BitmapGlyph([u8; 8]);
|
||||
|
||||
pub struct BitmapFont(BTreeMap<char, BitmapGlyph>);
|
||||
|
||||
impl BitmapFont {
|
||||
pub fn new() -> Self {
|
||||
let mut font = BTreeMap::new();
|
||||
font.insert(' ', BitmapGlyph([
|
||||
0b10101,
|
||||
0b01010,
|
||||
0b10101,
|
||||
0b01010,
|
||||
0b10101,
|
||||
0b01010,
|
||||
0b10101,
|
||||
0b01010,
|
||||
]));
|
||||
font.insert(
|
||||
'/',
|
||||
BitmapGlyph([
|
||||
0b00001,
|
||||
0b00010,
|
||||
0b00010,
|
||||
0b00100,
|
||||
0b00100,
|
||||
0b01000,
|
||||
0b01000,
|
||||
0b10000,
|
||||
]),
|
||||
);
|
||||
font.insert(
|
||||
'0',
|
||||
BitmapGlyph([
|
||||
0b01110,
|
||||
0b10001,
|
||||
0b10001,
|
||||
0b10101,
|
||||
0b10101,
|
||||
0b10001,
|
||||
0b10001,
|
||||
0b01110,
|
||||
]),
|
||||
);
|
||||
font.insert(
|
||||
'1',
|
||||
BitmapGlyph([
|
||||
0b00001, 0b00011, 0b00101, 0b00001, 0b00001, 0b00001, 0b00001, 0b00001,
|
||||
]),
|
||||
);
|
||||
font.insert(
|
||||
'2',
|
||||
BitmapGlyph([
|
||||
0b01110, 0b10001, 0b00001, 0b00001, 0b00010, 0b00100, 0b01000, 0b11111,
|
||||
]),
|
||||
);
|
||||
font.insert(
|
||||
'3',
|
||||
BitmapGlyph([
|
||||
0b01110, 0b10001, 0b00001, 0b01110, 0b00001, 0b00001, 0b10001, 0b01110,
|
||||
]),
|
||||
);
|
||||
font.insert(
|
||||
'4',
|
||||
BitmapGlyph([
|
||||
0b10001,
|
||||
0b10001,
|
||||
0b10001,
|
||||
0b11111,
|
||||
0b00001,
|
||||
0b00001,
|
||||
0b00001,
|
||||
0b00001,
|
||||
]),
|
||||
);
|
||||
font.insert(
|
||||
'5',
|
||||
BitmapGlyph([
|
||||
0b11111,
|
||||
0b10000,
|
||||
0b10000,
|
||||
0b11111,
|
||||
0b00001,
|
||||
0b00001,
|
||||
0b10001,
|
||||
0b01110,
|
||||
]),
|
||||
);
|
||||
font.insert(
|
||||
'6',
|
||||
BitmapGlyph([
|
||||
0b01110,
|
||||
0b10001,
|
||||
0b10000,
|
||||
0b10000,
|
||||
0b11110,
|
||||
0b10001,
|
||||
0b10001,
|
||||
0b01110,
|
||||
]),
|
||||
);
|
||||
font.insert(
|
||||
'7',
|
||||
BitmapGlyph([
|
||||
0b11111,
|
||||
0b00001,
|
||||
0b00001,
|
||||
0b00010,
|
||||
0b00110,
|
||||
0b00100,
|
||||
0b01000,
|
||||
0b01000,
|
||||
]),
|
||||
);
|
||||
font.insert(
|
||||
'8',
|
||||
BitmapGlyph([
|
||||
0b01110,
|
||||
0b10001,
|
||||
0b10001,
|
||||
0b01110,
|
||||
0b01110,
|
||||
0b10001,
|
||||
0b10001,
|
||||
0b01110,
|
||||
]),
|
||||
);
|
||||
font.insert(
|
||||
'9',
|
||||
BitmapGlyph([
|
||||
0b01110,
|
||||
0b10001,
|
||||
0b10001,
|
||||
0b10001,
|
||||
0b01111,
|
||||
0b00001,
|
||||
0b00001,
|
||||
0b01110,
|
||||
]),
|
||||
);
|
||||
Self(font)
|
||||
}
|
||||
}
|
||||
|
||||
impl Font<BitmapGlyph> for BitmapFont {
|
||||
fn glyph(&self, c: char) -> &BitmapGlyph {
|
||||
self.0.get(&c).unwrap_or(self.0.get(&' ').unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
impl Glyph for BitmapGlyph {
|
||||
fn draw(&self, canvas: &mut impl Canvas, x: usize, y: usize, color: &RGB) {
|
||||
for row in 0..8 {
|
||||
if self.0[row] & (1 << 4) > 0 {
|
||||
canvas.set_pixel(x, y + row, color);
|
||||
}
|
||||
if self.0[row] & (1 << 3) > 0 {
|
||||
canvas.set_pixel(x + 1, y + row, color);
|
||||
}
|
||||
if self.0[row] & (1 << 2) > 0 {
|
||||
canvas.set_pixel(x + 2, y + row, color);
|
||||
}
|
||||
if self.0[row] & (1 << 1) > 0 {
|
||||
canvas.set_pixel(x + 3, y + row, color);
|
||||
}
|
||||
if self.0[row] & 1 > 0 {
|
||||
canvas.set_pixel(x + 4, y + row, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn extents(&self) -> (usize, usize) {
|
||||
(5, 8)
|
||||
}
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
use crate::canvas::{Canvas, RGB};
|
||||
|
||||
mod bits_5_8;
|
||||
pub use bits_5_8::BitmapFont;
|
||||
|
||||
mod seven_segment;
|
||||
pub use seven_segment::SevenSegmentFont;
|
||||
|
||||
|
@ -396,13 +396,182 @@ impl SixteenSegmentFont {
|
||||
| SixteenSegmentGlyph::J
|
||||
| SixteenSegmentGlyph::K,
|
||||
);
|
||||
|
||||
font.insert(
|
||||
'a',
|
||||
SixteenSegmentGlyph::D1
|
||||
| SixteenSegmentGlyph::D2
|
||||
| SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert(
|
||||
'b',
|
||||
SixteenSegmentGlyph::D1
|
||||
| SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::F
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert(
|
||||
'c',
|
||||
SixteenSegmentGlyph::D1 | SixteenSegmentGlyph::E | SixteenSegmentGlyph::G1,
|
||||
);
|
||||
font.insert(
|
||||
'd',
|
||||
SixteenSegmentGlyph::B
|
||||
| SixteenSegmentGlyph::C
|
||||
| SixteenSegmentGlyph::D2
|
||||
| SixteenSegmentGlyph::G2
|
||||
| SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert(
|
||||
'e',
|
||||
SixteenSegmentGlyph::D1
|
||||
| SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::K,
|
||||
);
|
||||
font.insert(
|
||||
'f',
|
||||
SixteenSegmentGlyph::A2
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::G2
|
||||
| SixteenSegmentGlyph::I
|
||||
| SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert(
|
||||
'g',
|
||||
SixteenSegmentGlyph::A1
|
||||
| SixteenSegmentGlyph::D1
|
||||
| SixteenSegmentGlyph::F
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::I
|
||||
| SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert(
|
||||
'h',
|
||||
SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::F
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert('i', SixteenSegmentGlyph::L);
|
||||
font.insert(
|
||||
'j',
|
||||
SixteenSegmentGlyph::D1
|
||||
| SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::I
|
||||
| SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert(
|
||||
'k',
|
||||
SixteenSegmentGlyph::I
|
||||
| SixteenSegmentGlyph::J
|
||||
| SixteenSegmentGlyph::L
|
||||
| SixteenSegmentGlyph::M,
|
||||
);
|
||||
font.insert('l', SixteenSegmentGlyph::E | SixteenSegmentGlyph::F);
|
||||
font.insert(
|
||||
'm',
|
||||
SixteenSegmentGlyph::C
|
||||
| SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::L
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::G2,
|
||||
);
|
||||
font.insert(
|
||||
'n',
|
||||
SixteenSegmentGlyph::E | SixteenSegmentGlyph::L | SixteenSegmentGlyph::G1,
|
||||
);
|
||||
font.insert(
|
||||
'o',
|
||||
SixteenSegmentGlyph::D1
|
||||
| SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert(
|
||||
'p',
|
||||
SixteenSegmentGlyph::A1
|
||||
| SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::F
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::I,
|
||||
);
|
||||
font.insert(
|
||||
'q',
|
||||
SixteenSegmentGlyph::A1
|
||||
| SixteenSegmentGlyph::F
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::I
|
||||
| SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert('r', SixteenSegmentGlyph::E | SixteenSegmentGlyph::G1);
|
||||
font.insert(
|
||||
's',
|
||||
SixteenSegmentGlyph::A1
|
||||
| SixteenSegmentGlyph::D1
|
||||
| SixteenSegmentGlyph::F
|
||||
| SixteenSegmentGlyph::G1
|
||||
| SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert(
|
||||
't',
|
||||
SixteenSegmentGlyph::D1
|
||||
| SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::F
|
||||
| SixteenSegmentGlyph::G1,
|
||||
);
|
||||
font.insert(
|
||||
'u',
|
||||
SixteenSegmentGlyph::D1 | SixteenSegmentGlyph::E | SixteenSegmentGlyph::L,
|
||||
);
|
||||
font.insert('v', SixteenSegmentGlyph::E | SixteenSegmentGlyph::K);
|
||||
font.insert(
|
||||
'w',
|
||||
SixteenSegmentGlyph::C
|
||||
| SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::K
|
||||
| SixteenSegmentGlyph::M,
|
||||
);
|
||||
font.insert(
|
||||
'x',
|
||||
SixteenSegmentGlyph::H
|
||||
| SixteenSegmentGlyph::J
|
||||
| SixteenSegmentGlyph::K
|
||||
| SixteenSegmentGlyph::M,
|
||||
);
|
||||
font.insert(
|
||||
'y',
|
||||
SixteenSegmentGlyph::B
|
||||
| SixteenSegmentGlyph::C
|
||||
| SixteenSegmentGlyph::I
|
||||
| SixteenSegmentGlyph::D2
|
||||
| SixteenSegmentGlyph::G2,
|
||||
);
|
||||
font.insert(
|
||||
'z',
|
||||
SixteenSegmentGlyph::D1 | SixteenSegmentGlyph::G1 | SixteenSegmentGlyph::K,
|
||||
);
|
||||
font.insert(
|
||||
'@',
|
||||
SixteenSegmentGlyph::A1
|
||||
| SixteenSegmentGlyph::A2
|
||||
| SixteenSegmentGlyph::B
|
||||
| SixteenSegmentGlyph::D1
|
||||
| SixteenSegmentGlyph::D2
|
||||
| SixteenSegmentGlyph::E
|
||||
| SixteenSegmentGlyph::F
|
||||
| SixteenSegmentGlyph::G2,
|
||||
);
|
||||
Self(font)
|
||||
}
|
||||
}
|
||||
|
||||
impl Font<SixteenSegmentGlyph> for SixteenSegmentFont {
|
||||
fn glyph(&self, c: char) -> &SixteenSegmentGlyph {
|
||||
self.0.get(&c).unwrap()
|
||||
self.0.get(&c).unwrap_or(&SixteenSegmentGlyph::NONE)
|
||||
}
|
||||
}
|
||||
|
||||
@ -515,7 +684,6 @@ impl Glyph for SixteenSegmentGlyph {
|
||||
}
|
||||
|
||||
fn extents(&self) -> (usize, usize) {
|
||||
(8, 12)
|
||||
(9, 13)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,10 +14,10 @@ use rp_pico::{
|
||||
};
|
||||
|
||||
mod canvas;
|
||||
use canvas::{Canvas, RGB};
|
||||
use canvas::{Canvas, RGB, print};
|
||||
|
||||
mod font;
|
||||
use font::{Font, Glyph, SevenSegmentFont, SixteenSegmentFont};
|
||||
use font::{BitmapFont, Font, Glyph, SevenSegmentFont, SixteenSegmentFont};
|
||||
|
||||
mod st7789;
|
||||
use st7789::{ST7789Display, SETUP_PROGRAM};
|
||||
@ -59,13 +59,13 @@ impl Canvas for FrameBuf {
|
||||
unsafe fn main() -> ! {
|
||||
{
|
||||
use core::mem::MaybeUninit;
|
||||
const HEAP_SIZE: usize = 1024;
|
||||
const HEAP_SIZE: usize = 64 * 1024;
|
||||
static mut HEAP_MEM: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
|
||||
unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) }
|
||||
}
|
||||
|
||||
let font_seven = SevenSegmentFont::new();
|
||||
let font_sixteen = SixteenSegmentFont::new();
|
||||
let font_bitmap = BitmapFont::new();
|
||||
|
||||
// rp_pico::pac::Peripherals is a reference to physical hardware defined on the Pico.
|
||||
let mut peripherals = pac::Peripherals::take().unwrap();
|
||||
@ -151,187 +151,24 @@ unsafe fn main() -> ! {
|
||||
let white = RGB { r: 63, g: 63, b: 63 };
|
||||
|
||||
loop {
|
||||
print(&mut canvas, &font_sixteen, 1, 1, " !\"#$%&'<>*+,-./", &RGB{ r: 63, g: 63, b: 63 });
|
||||
print(&mut canvas, &font_sixteen, 1, 21, "0123456789| = ?", &RGB{ r: 63, g: 63, b: 63 });
|
||||
print(&mut canvas, &font_sixteen, 1, 41, "@ABCDEFGHIJKLMNO", &RGB{ r: 63, g: 63, b: 63 });
|
||||
print(&mut canvas, &font_sixteen, 1, 61, "PQRSTUVWXYZ[\\]^_", &RGB{ r: 63, g: 63, b: 63 });
|
||||
print(&mut canvas, &font_sixteen, 1, 81, "`abcdefghijklmno", &RGB{ r: 63, g: 63, b: 63 });
|
||||
print(&mut canvas, &font_sixteen, 1, 101, "pqrstuvwxyz{|}", &RGB{ r: 63, g: 63, b: 63 });
|
||||
|
||||
|
||||
print(&mut canvas, &font_bitmap, 1, 121, " !\"#$%&'<>*+,-./", &RGB{ r: 63, g: 63, b: 63 });
|
||||
print(&mut canvas, &font_bitmap, 1, 141, "0123456789| = ?", &RGB{ r: 63, g: 63, b: 63 });
|
||||
/*
|
||||
draw_seven_segment(0, &mut frame, 0, 0, (255, 255, 255));
|
||||
draw_seven_segment(1, &mut frame, 7, 0, (255, 255, 255));
|
||||
draw_seven_segment(2, &mut frame, 14, 0, (255, 255, 255));
|
||||
draw_seven_segment(3, &mut frame, 21, 0, (255, 255, 255));
|
||||
draw_seven_segment(4, &mut frame, 28, 0, (255, 255, 255));
|
||||
draw_seven_segment(5, &mut frame, 35, 0, (255, 255, 255));
|
||||
draw_seven_segment(6, &mut frame, 42, 0, (255, 255, 255));
|
||||
draw_seven_segment(7, &mut frame, 49, 0, (255, 255, 255));
|
||||
draw_seven_segment(8, &mut frame, 56, 0, (255, 255, 255));
|
||||
draw_seven_segment(9, &mut frame, 63, 0, (255, 255, 255));
|
||||
print(&mut canvas, &font_bitmap, 1, 161, "@ABCDEFGHIJKLMNO", &RGB{ r: 63, g: 63, b: 63 });
|
||||
print(&mut canvas, &font_bitmap, 1, 181, "PQRSTUVWXYZ[\\]^_", &RGB{ r: 63, g: 63, b: 63 });
|
||||
print(&mut canvas, &font_bitmap, 1, 201, "`abcdefghijklmno", &RGB{ r: 63, g: 63, b: 63 });
|
||||
print(&mut canvas, &font_bitmap, 1, 221, "pqrstuvwxyz{|}", &RGB{ r: 63, g: 63, b: 63 });
|
||||
*/
|
||||
|
||||
font_seven
|
||||
.glyph(' ')
|
||||
.draw(&mut canvas, 0, 0, &white);
|
||||
font_seven
|
||||
.glyph('0')
|
||||
.draw(&mut canvas, 11, 0, &white);
|
||||
font_seven
|
||||
.glyph('1')
|
||||
.draw(&mut canvas, 22, 0, &white);
|
||||
font_seven
|
||||
.glyph('2')
|
||||
.draw(&mut canvas, 33, 0, &white);
|
||||
font_seven
|
||||
.glyph('3')
|
||||
.draw(&mut canvas, 44, 0, &white);
|
||||
font_seven
|
||||
.glyph('4')
|
||||
.draw(&mut canvas, 55, 0, &white);
|
||||
font_seven
|
||||
.glyph('5')
|
||||
.draw(&mut canvas, 66, 0, &white);
|
||||
font_seven
|
||||
.glyph('6')
|
||||
.draw(&mut canvas, 77, 0, &white);
|
||||
font_seven
|
||||
.glyph('7')
|
||||
.draw(&mut canvas, 88, 0, &white);
|
||||
font_seven
|
||||
.glyph('8')
|
||||
.draw(&mut canvas, 99, 0, &white);
|
||||
font_seven
|
||||
.glyph('9')
|
||||
.draw(&mut canvas, 110, 0, &white);
|
||||
|
||||
font_seven
|
||||
.glyph('A')
|
||||
.draw(&mut canvas, 121, 0, &white);
|
||||
font_seven
|
||||
.glyph('B')
|
||||
.draw(&mut canvas, 132, 0, &white);
|
||||
font_seven
|
||||
.glyph('C')
|
||||
.draw(&mut canvas, 143, 0, &white);
|
||||
font_seven
|
||||
.glyph('D')
|
||||
.draw(&mut canvas, 154, 0, &white);
|
||||
font_seven
|
||||
.glyph('E')
|
||||
.draw(&mut canvas, 165, 0, &white);
|
||||
font_seven
|
||||
.glyph('F')
|
||||
.draw(&mut canvas, 0, 20, &white);
|
||||
|
||||
font_sixteen
|
||||
.glyph(' ')
|
||||
.draw(&mut canvas, 0, 20, &white);
|
||||
font_sixteen
|
||||
.glyph('0')
|
||||
.draw(&mut canvas, 11, 20, &white);
|
||||
font_sixteen
|
||||
.glyph('1')
|
||||
.draw(&mut canvas, 22, 20, &white);
|
||||
font_sixteen
|
||||
.glyph('2')
|
||||
.draw(&mut canvas, 33, 20, &white);
|
||||
font_sixteen
|
||||
.glyph('3')
|
||||
.draw(&mut canvas, 44, 20, &white);
|
||||
font_sixteen
|
||||
.glyph('4')
|
||||
.draw(&mut canvas, 55, 20, &white);
|
||||
font_sixteen
|
||||
.glyph('5')
|
||||
.draw(&mut canvas, 66, 20, &white);
|
||||
font_sixteen
|
||||
.glyph('6')
|
||||
.draw(&mut canvas, 77, 20, &white);
|
||||
font_sixteen
|
||||
.glyph('7')
|
||||
.draw(&mut canvas, 88, 20, &white);
|
||||
font_sixteen
|
||||
.glyph('8')
|
||||
.draw(&mut canvas, 99, 20, &white);
|
||||
font_sixteen
|
||||
.glyph('9')
|
||||
.draw(&mut canvas, 110, 20, &white);
|
||||
|
||||
font_sixteen
|
||||
.glyph('A')
|
||||
.draw(&mut canvas, 0, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('B')
|
||||
.draw(&mut canvas, 11, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('C')
|
||||
.draw(&mut canvas, 22, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('D')
|
||||
.draw(&mut canvas, 33, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('E')
|
||||
.draw(&mut canvas, 44, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('F')
|
||||
.draw(&mut canvas, 55, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('G')
|
||||
.draw(&mut canvas, 66, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('H')
|
||||
.draw(&mut canvas, 77, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('I')
|
||||
.draw(&mut canvas, 88, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('J')
|
||||
.draw(&mut canvas, 99, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('K')
|
||||
.draw(&mut canvas, 110, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('L')
|
||||
.draw(&mut canvas, 121, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('M')
|
||||
.draw(&mut canvas, 132, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('N')
|
||||
.draw(&mut canvas, 143, 40, &white);
|
||||
font_sixteen
|
||||
.glyph('O')
|
||||
.draw(&mut canvas, 154, 40, &white);
|
||||
|
||||
font_sixteen
|
||||
.glyph('P')
|
||||
.draw(&mut canvas, 0, 60, &white);
|
||||
font_sixteen
|
||||
.glyph('Q')
|
||||
.draw(&mut canvas, 11, 60, &white);
|
||||
font_sixteen
|
||||
.glyph('R')
|
||||
.draw(&mut canvas, 22, 60, &white);
|
||||
font_sixteen
|
||||
.glyph('S')
|
||||
.draw(&mut canvas, 33, 60, &white);
|
||||
font_sixteen
|
||||
.glyph('T')
|
||||
.draw(&mut canvas, 44, 60, &white);
|
||||
font_sixteen
|
||||
.glyph('U')
|
||||
.draw(&mut canvas, 55, 60, &white);
|
||||
font_sixteen
|
||||
.glyph('V')
|
||||
.draw(&mut canvas, 66, 60, &white);
|
||||
font_sixteen
|
||||
.glyph('W')
|
||||
.draw(&mut canvas, 77, 60, &white);
|
||||
font_sixteen
|
||||
.glyph('X')
|
||||
.draw(&mut canvas, 88, 60, &white);
|
||||
font_sixteen
|
||||
.glyph('Y')
|
||||
.draw(&mut canvas, 99, 60, &white);
|
||||
font_sixteen
|
||||
.glyph('Z')
|
||||
.draw(&mut canvas, 110, 60, &white);
|
||||
|
||||
canvas.square(10, 70, 160, 310, &white);
|
||||
// canvas.square(10, 70, 160, 310, &white);
|
||||
|
||||
{
|
||||
let display = display.acquire();
|
||||
|
Loading…
Reference in New Issue
Block a user