From ac9f965ac913e1de842c8a709d2a66d1bfdc353c Mon Sep 17 00:00:00 2001 From: John Whitington Date: Tue, 28 Jan 2025 16:39:10 +0800 Subject: [PATCH] New font strategy for 10_001 --- cpdffont.ml | 2 +- cpdffont.mli | 2 +- cpdfua.ml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpdffont.ml b/cpdffont.ml index 117f061..c3619f9 100644 --- a/cpdffont.ml +++ b/cpdffont.ml @@ -268,7 +268,7 @@ let list_font pdf page (name, dict) = | Some (Pdf.Name n) -> Pdfwrite.string_of_pdf (Pdf.Name n) | _ -> "" in - (page, name, subtype, basefont, encoding, Pdf.Null) + (page, name, subtype, basefont, encoding, Pdf.direct pdf dict) (* List the fonts used in an xobject, and in any of the xobjects it has. Do not process an xobject twice. *) diff --git a/cpdffont.mli b/cpdffont.mli index 107221a..aa168d4 100644 --- a/cpdffont.mli +++ b/cpdffont.mli @@ -5,7 +5,7 @@ (** Print font list to stdout *) val print_fonts : ?json:bool -> Pdf.t -> int list -> unit -(** Return font list. Page number, name, subtype, basefont, encoding. *) +(** Return font list. Page number, name, subtype, basefont, encoding, font (direct). *) val list_fonts : Pdf.t -> int list -> (int * string * string * string * string * Pdf.pdfobject) list (** Return font list in JSON format *) diff --git a/cpdfua.ml b/cpdfua.ml index 699cc8a..cc075e8 100644 --- a/cpdfua.ml +++ b/cpdfua.ml @@ -468,7 +468,7 @@ let matterhorn_10_001 _ _ pdf = if not (List.for_all (mem' allowed_names) names) then merror () in let check_font font = - Printf.printf "Check font: %s\n" (Pdfwrite.string_of_pdf font); + (*Printf.printf "Check font: %s\n" (Pdfwrite.string_of_pdf font);*) match Pdf.lookup_direct pdf "/ToUnicode" font with | Some _ -> (* a) *) () | _ ->