From 4ade9ab7edd683ebca0d7c8de9b67c0881181d93 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Tue, 1 Nov 2016 19:00:19 +0000 Subject: [PATCH] Updates cpdf to use trunk camlpdf AFM reader --- cpdf.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cpdf.ml b/cpdf.ml index 770909f..d94599b 100644 --- a/cpdf.ml +++ b/cpdf.ml @@ -1608,7 +1608,11 @@ let extract_widths_firstlast width_data = match sorted, rev sorted with (first, _)::_, (last, _)::_ -> for x = first to last do - if not (Hashtbl.mem width_data x) then Hashtbl.add width_data x 0 + if not (Hashtbl.mem width_data x) then + begin + Printf.printf "Failed to find width for char %i\n" x; + Hashtbl.add width_data x 0 + end done; (first, last, map snd (List.sort compare (list_of_hashtbl width_data))) @@ -1616,7 +1620,7 @@ let extract_widths_firstlast width_data = let make_font embed fontname = let font = unopt (Pdftext.standard_font_of_name ("/" ^ fontname)) in - let header, width_data, _ = Pdfstandard14.afm_data font in + let header, width_data, _, _ = Pdfstandard14.afm_data font in (* Print out the width data *) (*Hashtbl.iter (Printf.printf "%i -> %i\n")