MCPcopy Create free account
hub / github.com/endbasic/endbasic / chars_in_area

Method chars_in_area

std/src/gfx/lcd/fonts/mod.rs:66–75  ·  view source on GitHub ↗

Computes the number of characters that fit within the given pixels `area`.

(&self, area: SizeInPixels)

Source from the content-addressed store, hash-verified

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.

Callers 3

newMethod · 0.80
newMethod · 0.80
get_infoMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected