From 5106968be7fccd64f97e38fcfd426216d3a3c174 Mon Sep 17 00:00:00 2001 From: Ln-north Date: Thu, 27 Jul 2023 11:10:20 +0900 Subject: [PATCH] fix(dict): Make values that may take an offset in TopDICT usize --- read-fonts/src/tables/postscript/dict.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/read-fonts/src/tables/postscript/dict.rs b/read-fonts/src/tables/postscript/dict.rs index 3901bdf4e..7fa821219 100644 --- a/read-fonts/src/tables/postscript/dict.rs +++ b/read-fonts/src/tables/postscript/dict.rs @@ -233,8 +233,8 @@ pub enum Entry { BlueFuzz(Fixed), LanguageGroup(i32), ExpansionFactor(Fixed), - Encoding(i32), - Charset(i32), + Encoding(usize), + Charset(usize), UniqueId(i32), Xuid, SyntheticBase(i32), @@ -378,8 +378,8 @@ fn parse_entry(op: Operator, stack: &mut Stack) -> Result { BlueFuzz => Entry::BlueFuzz(stack.pop_fixed()?), LanguageGroup => Entry::LanguageGroup(stack.pop_i32()?), ExpansionFactor => Entry::ExpansionFactor(stack.pop_fixed()?), - Encoding => Entry::Encoding(stack.pop_i32()?), - Charset => Entry::Charset(stack.pop_i32()?), + Encoding => Entry::Encoding(stack.pop_i32()? as usize), + Charset => Entry::Charset(stack.pop_i32()? as usize), UniqueId => Entry::UniqueId(stack.pop_i32()?), Xuid => Entry::Xuid, SyntheticBase => Entry::SyntheticBase(stack.pop_i32()?),