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:
parent
14b2537c15
commit
024f66ba87
@ -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();
|
||||
|
@ -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()?)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user