Updates cpdf to use trunk camlpdf AFM reader
This commit is contained in:
parent
818c462c60
commit
4ade9ab7ed
8
cpdf.ml
8
cpdf.ml
|
@ -1608,7 +1608,11 @@ let extract_widths_firstlast width_data =
|
||||||
match sorted, rev sorted with
|
match sorted, rev sorted with
|
||||||
(first, _)::_, (last, _)::_ ->
|
(first, _)::_, (last, _)::_ ->
|
||||||
for x = first to last do
|
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;
|
done;
|
||||||
(first, last,
|
(first, last,
|
||||||
map snd (List.sort compare (list_of_hashtbl width_data)))
|
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 make_font embed fontname =
|
||||||
let font = unopt (Pdftext.standard_font_of_name ("/" ^ fontname)) in
|
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 *)
|
(* Print out the width data *)
|
||||||
(*Hashtbl.iter
|
(*Hashtbl.iter
|
||||||
(Printf.printf "%i -> %i\n")
|
(Printf.printf "%i -> %i\n")
|
||||||
|
|
Loading…
Reference in New Issue