Began -no-embed-fonts work

This commit is contained in:
John Whitington 2015-04-13 14:17:48 +01:00
parent 84aed7d070
commit a81fc4ef8d
4 changed files with 17 additions and 4 deletions

4
cpdf.ml Executable file → Normal file
View File

@ -1532,6 +1532,10 @@ let extract_widths_firstlast width_data =
let make_font fontname = let make_font 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 *)
Hashtbl.iter
(Printf.printf "%i -> %i\n")
width_data;
let firstchar, lastchar, widths = extract_widths_firstlast width_data in let firstchar, lastchar, widths = extract_widths_firstlast width_data in
let flags = Pdfstandard14.flags_of_standard_font font in let flags = Pdfstandard14.flags_of_standard_font font in
let fontbbox = extract_fontbbox header "FontBBox" in let fontbbox = extract_fontbbox header "FontBBox" in

View File

@ -369,7 +369,8 @@ type args =
mutable recrypt : bool; mutable recrypt : bool;
mutable was_decrypted_with_owner : bool; mutable was_decrypted_with_owner : bool;
mutable creator : string option; mutable creator : string option;
mutable producer : string option} mutable producer : string option;
mutable embedfonts : bool}
let args = let args =
{op = None; {op = None;
@ -450,7 +451,8 @@ let args =
recrypt = false; recrypt = false;
was_decrypted_with_owner = false; was_decrypted_with_owner = false;
producer = None; producer = None;
creator = None} creator = None;
embedfonts = true}
let reset_arguments () = let reset_arguments () =
args.op <- None; args.op <- None;
@ -526,9 +528,10 @@ let reset_arguments () =
args.labelstartval <- 1; args.labelstartval <- 1;
args.squeeze <- false; args.squeeze <- false;
args.producer <- None; args.producer <- None;
args.creator <- None args.creator <- None;
args.embedfonts <- true
(* Do not reset original_filename or cpdflin or was_encrypted or (* Do not reset original_filename or cpdflin or was_encrypted or
* was_decrypted_with_owner or recrypt, since we want it to work across ANDs. *) * was_decrypted_with_owner or recrypt, since we want these to work across ANDs. *)
let string_of_permission = function let string_of_permission = function
| Pdfcrypt.NoEdit -> "No edit" | Pdfcrypt.NoEdit -> "No edit"
@ -1356,6 +1359,9 @@ let setsqueezelogto s =
let setstayonerror () = let setstayonerror () =
set stay_on_error set stay_on_error
let setnoembedfont () =
args.embedfonts <- false
(* Parse a control file, make an argv, and then make Arg parse it. *) (* Parse a control file, make an argv, and then make Arg parse it. *)
let rec make_control_argv_and_parse filename = let rec make_control_argv_and_parse filename =
control_args := !control_args @ parse_control_file filename control_args := !control_args @ parse_control_file filename
@ -1587,6 +1593,9 @@ and specs =
("-font-size", ("-font-size",
Arg.Float setfontsize, Arg.Float setfontsize,
" Set the font size"); " Set the font size");
("-no-embed-font",
Arg.Unit setnoembedfont,
"Do not embed fonts");
("-color", ("-color",
Arg.String setcolor, Arg.String setcolor,
" Set the color"); " Set the color");

0
xmlm.ml Executable file → Normal file
View File

0
xmlm.mli Executable file → Normal file
View File