Skip to content

Commit

Permalink
restore specific error variants
Browse files Browse the repository at this point in the history
  • Loading branch information
dfrg committed Aug 8, 2023
1 parent c75229f commit 9d8bac6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions skrifa/src/scale/cff/scaler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use read_fonts::{
variations::ItemVariationStore,
},
types::{F2Dot14, Fixed, GlyphId, Pen},
FontData, FontRead, ReadError, TableProvider,
FontData, FontRead, TableProvider,
};

use super::hint::{HintParams, HintState};
Expand Down Expand Up @@ -190,9 +190,7 @@ impl<'a> Scaler<'a> {
.top_dict
.charstrings
.as_ref()
.ok_or(Error::Read(ReadError::MalformedData(
"missing charstrings INDEX in CFF table",
)))?
.ok_or(Error::MissingCharstrings)?
.get(glyph_id.to_u16() as usize)?;
let subrs = subfont.subrs(self)?;
let blend_state = subfont.blend_state(self, coords)?;
Expand Down Expand Up @@ -242,9 +240,7 @@ impl<'a> Scaler<'a> {
// available.
self.top_dict.private_dict_range.clone()
}
.ok_or(Error::Read(ReadError::MalformedData(
"missing Private DICT in CFF table",
)))
.ok_or(Error::MissingPrivateDict)
}
}

Expand Down

0 comments on commit 9d8bac6

Please sign in to comment.