remove pixels, add softbuffer for drawing to window
This commit is contained in:
parent
205cd566cb
commit
0aa66e3ebd
7 changed files with 268 additions and 747 deletions
|
|
@ -52,12 +52,11 @@ impl FontRenderer8x8 {
|
|||
assert_eq!(canvas.pixels.len(), TILE_SIZE * TILE_SIZE);
|
||||
assert_eq!(canvas.stride, TILE_SIZE);
|
||||
let fallback_char = font.glyph_for_char(Self::FALLBACK_CHAR);
|
||||
let result = Self {
|
||||
Self {
|
||||
font: SendFont(font),
|
||||
fallback_char,
|
||||
canvas: Mutex::new(canvas),
|
||||
};
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_name(family_name: String) -> Self {
|
||||
|
|
@ -118,7 +117,7 @@ impl FontRenderer8x8 {
|
|||
.as_ref()
|
||||
.glyph_for_char(char)
|
||||
.or(self.fallback_char)
|
||||
.ok_or_else(|| GlyphNotFound(char))
|
||||
.ok_or(GlyphNotFound(char))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue