mirror of https://github.com/wayvr-org/wayvr.git
fix: font load error panic
This commit is contained in:
parent
9a693862ba
commit
6ee0cb4fd1
|
|
@ -179,7 +179,10 @@ impl FontCache {
|
|||
) -> anyhow::Result<Rc<Glyph>> {
|
||||
let key = self.get_font_for_cp(cp, size);
|
||||
|
||||
let font = &mut self.collections[size].fonts[key];
|
||||
let Some(font) = &mut self.collections[size].fonts.get_mut(key) else {
|
||||
log::warn!("No font found for codepoint: {}", cp);
|
||||
return Ok(self.collections[size].fonts[0].glyphs[0].clone());
|
||||
};
|
||||
|
||||
if let Some(glyph) = font.glyphs.get(cp) {
|
||||
return Ok(glyph.clone());
|
||||
|
|
|
|||
Loading…
Reference in New Issue