1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 12:23:46 +03:00

fonts: improve diagnostics

This commit is contained in:
Wez Furlong 2021-04-08 01:12:37 -07:00
parent 14b2537c15
commit 024f66ba87
2 changed files with 7 additions and 3 deletions

View File

@ -113,7 +113,7 @@ impl FontDatabase {
let path = entry.path();
parse_and_collect_font_info(path, &mut font_info)
.map_err(|err| {
log::trace!("failed to read {}: {}", path.display(), err);
log::trace!("failed to read {}: {:#}", path.display(), err);
err
})
.ok();

View File

@ -460,8 +460,12 @@ impl Library {
/// For a TTC, it will be the number of contained fonts
pub fn query_num_faces(&self, handle: &FontDataHandle) -> anyhow::Result<u32> {
let face = match handle {
FontDataHandle::OnDisk { path, .. } => self.new_face(path.to_str().unwrap(), -1)?,
FontDataHandle::Memory { data, .. } => self.new_face_from_slice(data.clone(), -1)?,
FontDataHandle::OnDisk { path, .. } => self
.new_face(path.to_str().unwrap(), -1)
.context("query_num_faces")?,
FontDataHandle::Memory { data, .. } => self
.new_face_from_slice(data.clone(), -1)
.context("query_num_faces")?,
};
Ok(unsafe { (*face.face).num_faces }.try_into()?)
}