Writes a single character `ch` at `pos`.
(rasops: &mut R, font: &Font, xy: PixelsXY, text: &str)
| 409 | |
| 410 | /// Writes a single character `ch` at `pos`. |
| 411 | pub fn draw_text<R>(rasops: &mut R, font: &Font, xy: PixelsXY, text: &str) -> io::Result<()> |
| 412 | where |
| 413 | R: RasterOps, |
| 414 | { |
| 415 | let mut pos = xy; |
| 416 | for ch in text.chars() { |
| 417 | draw_char(rasops, font, pos, ch)?; |
| 418 | pos.x += i16::try_from(font.glyph_size.width).expect("Must fit"); |
| 419 | } |
| 420 | Ok(()) |
| 421 | } |
| 422 | |
| 423 | /// Draws a triangle via `rasops`. |
| 424 | pub fn draw_tri<R>(rasops: &mut R, x1y1: PixelsXY, x2y2: PixelsXY, x3y3: PixelsXY) -> io::Result<()> |