Worked on text rendering

pull/2/head
Able 2021-11-28 22:00:58 -06:00
parent 66e5ac8946
commit 5260b5441e
No known key found for this signature in database
GPG Key ID: 2BB8F62388A6A225
1 changed files with 7 additions and 8 deletions

View File

@ -87,16 +87,15 @@ impl AglApi for GraphicsRenderer {
.with_scale_and_position(scale as f32, point(coords.x as f32, coords.y as f32));
// Draw it.
if let Some(q) = font.outline_glyph(q_glyph) {
// dbg!(q);
q.draw(|x, y, c| {
/* draw pixel `(x, y)` with coverage: `c` */
println!("h");
self.put_pixel(
Point {
x: x as u16,
y: y as u16,
},
color,
);
dbg!(x, y, c);
let coordinates = x as u16 + (WIDTH as u16).wrapping_mul(y as u16);
self.buff[coordinates as usize] = color;
});
}
}