Fix block cursor does not render italic for vim (#10249)

Release Notes:

- Fixed #8799
This commit is contained in:
Hans 2024-04-09 04:50:50 +08:00 committed by GitHub
parent cf5a113751
commit 0390df27d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 1 deletions

View file

@ -117,6 +117,17 @@ impl TextSystem {
}
}
/// Get the Font for the Font Id.
pub fn get_font_for_id(&self, id: FontId) -> Option<Font> {
let lock = self.font_ids_by_font.read();
lock.iter()
.filter_map(|(font, result)| match result {
Ok(font_id) if *font_id == id => Some(font.clone()),
_ => None,
})
.next()
}
/// Resolves the specified font, falling back to the default font stack if
/// the font fails to load.
///