Fix missing_fonts for Type3

This commit is contained in:
John Whitington 2024-07-02 18:17:00 +01:00
parent 99e8d6d544
commit fc8d119347
2 changed files with 12 additions and 10 deletions

View File

@ -84,6 +84,9 @@ let copy_font frompdf fontname fontpage range pdf =
(* Missing Fonts *) (* Missing Fonts *)
let is_missing pdf dict = let is_missing pdf dict =
match Pdf.lookup_direct pdf "/Subtype" dict with
| Some (Pdf.Name "/Type3") -> false
| _ ->
match Pdf.lookup_direct pdf "/FontDescriptor" dict with match Pdf.lookup_direct pdf "/FontDescriptor" dict with
| None -> true | None -> true
| Some d -> | Some d ->

View File

@ -977,7 +977,6 @@ let matterhorn_31_008 _ _ pdf =
(* NB This, for now, reports all unembedded fonts, save for Type 3 ones... *) (* NB This, for now, reports all unembedded fonts, save for Type 3 ones... *)
let matterhorn_31_009 _ _ pdf = let matterhorn_31_009 _ _ pdf =
let l = Cpdffont.missing_fonts_return pdf (ilist 1 (Pdfpage.endpage pdf)) in let l = Cpdffont.missing_fonts_return pdf (ilist 1 (Pdfpage.endpage pdf)) in
let l = lose (function (_, _, "/Type3", _, _) -> true | _ -> false) l in
if l <> [] then if l <> [] then
raise (MatterhornError (`List (map (fun (a, b, c, d, e) -> `String (Printf.sprintf "%i %s %s %s %s" a b c d e)) l))) raise (MatterhornError (`List (map (fun (a, b, c, d, e) -> `String (Printf.sprintf "%i %s %s %s %s" a b c d e)) l)))