1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 21:32:13 +03:00

font: avoid running out of fallbacks!

The recent presentation logic needs to be tweaked to ensure that
we ignore presentation when we reach the fallback font, otherwise
we'll end up in a bad error stack and crash the program.
This commit is contained in:
Wez Furlong 2021-08-11 22:37:07 -07:00
parent 0866e5d213
commit 99074c6dc3

View File

@ -190,10 +190,13 @@ impl HarfbuzzShaper {
loop {
match self.load_fallback(font_idx).context("load_fallback")? {
Some(mut pair) => {
if let Some(p) = presentation {
if pair.presentation != p {
font_idx += 1;
continue;
// Ignore presentation if we've reached the last resort font
if font_idx + 1 < self.fonts.len() {
if let Some(p) = presentation {
if pair.presentation != p {
font_idx += 1;
continue;
}
}
}
let size = pair.face.set_font_size(font_size, dpi)?;