mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 13:52:55 +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:
parent
0866e5d213
commit
99074c6dc3
@ -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)?;
|
||||
|
Loading…
Reference in New Issue
Block a user