diff --git a/crates/redact/src/type3.rs b/crates/redact/src/type3.rs index 0542e002e5..4f9a4206af 100644 --- a/crates/redact/src/type3.rs +++ b/crates/redact/src/type3.rs @@ -248,7 +248,11 @@ fn scan_content_stream( for op in parsed.ops { match op.op.as_slice() { b"q" => stack.push(current_font), - b"Q" => current_font = stack.pop().unwrap_or(None), + b"Q" => { + if let Some(saved) = stack.pop() { + current_font = saved; + } + } b"Tf" => { if let Some(name) = op.name(0) { current_font = resolve_font_in_res(ctx.doc, res, name).map(|(k, _)| k); diff --git a/crates/redact/src/type3_tables.rs b/crates/redact/src/type3_tables.rs index e860a07581..c99917b0b0 100644 --- a/crates/redact/src/type3_tables.rs +++ b/crates/redact/src/type3_tables.rs @@ -420,7 +420,7 @@ pub(crate) static WIN_ANSI: [Option<&[u8]>; 256] = [ None, Some(b"zcaron"), Some(b"Ydieresis"), - Some(b"nbspace"), + Some(b"space"), Some(b"exclamdown"), Some(b"cent"), Some(b"sterling"), @@ -433,7 +433,7 @@ pub(crate) static WIN_ANSI: [Option<&[u8]>; 256] = [ Some(b"ordfeminine"), Some(b"guillemotleft"), Some(b"logicalnot"), - Some(b"sfthyphen"), + Some(b"hyphen"), Some(b"registered"), Some(b"macron"), Some(b"degree"), @@ -721,7 +721,7 @@ pub(crate) static MAC_ROMAN: [Option<&[u8]>; 256] = [ Some(b"guillemotleft"), Some(b"guillemotright"), Some(b"ellipsis"), - Some(b"nbspace"), + Some(b"space"), Some(b"Agrave"), Some(b"Atilde"), Some(b"Otilde"),