summaryrefslogtreecommitdiff
path: root/src/font/book.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-09-30 11:22:45 +0200
committerLaurenz <laurmaedje@gmail.com>2022-09-30 11:23:09 +0200
commit7ef6cb31df0fe1ebec99b1077053a586a349f530 (patch)
treec4527c31521859bcb9c8ca5eafb14e6efb613bb0 /src/font/book.rs
parent9db89b376da33f99867ca511fe701e067432196d (diff)
Bump ttf-parser
Diffstat (limited to 'src/font/book.rs')
-rw-r--r--src/font/book.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/font/book.rs b/src/font/book.rs
index 29190516..d900d3c4 100644
--- a/src/font/book.rs
+++ b/src/font/book.rs
@@ -173,7 +173,7 @@ impl FontInfo {
pub fn from_data<'a>(data: &'a [u8]) -> impl Iterator<Item = FontInfo> + 'a {
let count = ttf_parser::fonts_in_collection(data).unwrap_or(1);
(0 .. count).filter_map(move |index| {
- let ttf = ttf_parser::Face::from_slice(data, index).ok()?;
+ let ttf = ttf_parser::Face::parse(data, index).ok()?;
Self::from_ttf(&ttf)
})
}
@@ -239,7 +239,8 @@ impl FontInfo {
// Determine whether this is a serif or sans-serif font.
if let Some(panose) = ttf
- .table_data(Tag::from_bytes(b"OS/2"))
+ .raw_face()
+ .table(Tag::from_bytes(b"OS/2"))
.and_then(|os2| os2.get(32 .. 45))
{
if matches!(panose, [2, 2 ..= 10, ..]) {