Skip to content

Commit

Permalink
Check for and surface cmap conflicts.
Browse files Browse the repository at this point in the history
Fixes #457
  • Loading branch information
rictic committed Mar 20, 2024
1 parent 6c6b830 commit f54b52b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ clap = { version = "4.0.32", features = ["derive"] }
rayon = "1.6"

# fontations etc
write-fonts = { version = "0.24.0", features = ["serde", "read"] }
write-fonts = { version = "0.25.0", features = ["serde", "read"] }
skrifa = "0.17.0"
norad = "0.12"

Expand Down
2 changes: 1 addition & 1 deletion fontbe/src/cmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Work<Context, AnyWorkId, Error> for CmapWork {
.collect::<Vec<_>>()
});

let cmap = Cmap::from_mappings(mappings);
let cmap = Cmap::from_mappings(mappings)?;
context.cmap.set_unconditionally(cmap.into());
Ok(())
}
Expand Down
3 changes: 3 additions & 0 deletions fontbe/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use thiserror::Error;
use write_fonts::{
read::ReadError,
tables::{
cmap::CmapConflict,
glyf::MalformedPath,
gvar::{iup::IupError, GvarInputError},
},
Expand Down Expand Up @@ -87,6 +88,8 @@ pub enum Error {
MissingGlyphId(GlyphName),
#[error("Missing kern group {0:?}")]
MissingKernGroup(KernGroup),
#[error("Error making CMap: {0}")]
CmapConflict(#[from] CmapConflict),
}

#[derive(Debug)]
Expand Down

0 comments on commit f54b52b

Please sign in to comment.