Computes the number of characters that fit within the given pixels `area`.
(&self, area: SizeInPixels)
| 64 | |
| 65 | /// Computes the number of characters that fit within the given pixels `area`. |
| 66 | pub fn chars_in_area(&self, area: SizeInPixels) -> CharsXY { |
| 67 | CharsXY::new( |
| 68 | area.width |
| 69 | .checked_div(u16::try_from(self.glyph_size.width).expect("Must fit")) |
| 70 | .expect("Glyph size tested for non-zero during init"), |
| 71 | area.height |
| 72 | .checked_div(u16::try_from(self.glyph_size.height).expect("Must fit")) |
| 73 | .expect("Glyph size tested for non-zero during init"), |
| 74 | ) |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | /// Registry of all available fonts. |