This commit is contained in:
John Whitington 2022-09-12 18:57:01 +01:00
parent f1792ce448
commit 69b76f4746
1 changed files with 9 additions and 0 deletions

View File

@ -384,6 +384,7 @@ type args =
mutable fontencoding : Pdftext.encoding; mutable fontencoding : Pdftext.encoding;
mutable fontname : string; mutable fontname : string;
mutable fontsize : float; mutable fontsize : float;
mutable fontttfmore : bool;
mutable color : Cpdfaddtext.color; mutable color : Cpdfaddtext.color;
mutable opacity : float; mutable opacity : float;
mutable position : Cpdfposition.position; mutable position : Cpdfposition.position;
@ -507,6 +508,7 @@ let args =
fontencoding = Pdftext.WinAnsiEncoding; fontencoding = Pdftext.WinAnsiEncoding;
fontname = "Times-Roman"; fontname = "Times-Roman";
fontsize = 12.; fontsize = 12.;
fontttfmore = false;
color = Cpdfaddtext.RGB (0., 0., 0.); color = Cpdfaddtext.RGB (0., 0., 0.);
opacity = 1.; opacity = 1.;
position = Cpdfposition.TopLeft 100.; position = Cpdfposition.TopLeft 100.;
@ -630,6 +632,7 @@ let reset_arguments () =
args.fontencoding <- Pdftext.WinAnsiEncoding; args.fontencoding <- Pdftext.WinAnsiEncoding;
args.fontname <- "Times-Roman"; args.fontname <- "Times-Roman";
args.fontsize <- 12.; args.fontsize <- 12.;
args.fontttfmore <- false;
args.color <- Cpdfaddtext.RGB (0., 0., 0.); args.color <- Cpdfaddtext.RGB (0., 0., 0.);
args.opacity <- 1.; args.opacity <- 1.;
args.position <- Cpdfposition.TopLeft 100.; args.position <- Cpdfposition.TopLeft 100.;
@ -1726,6 +1729,9 @@ let setnowarnrotate () =
let setfontttf s = let setfontttf s =
args.fontfile <- Some (Pdfio.bytes_of_string (contents_of_file s)) args.fontfile <- Some (Pdfio.bytes_of_string (contents_of_file s))
let setfontttfmore () =
args.fontttfmore <- true
let setfontttfencoding s = let setfontttfencoding s =
args.fontencoding <- args.fontencoding <-
match s with match s with
@ -2044,6 +2050,9 @@ and specs =
("-font-ttf-encoding", ("-font-ttf-encoding",
Arg.String setfontttfencoding, Arg.String setfontttfencoding,
" Set the encoding for the TrueType font"); " Set the encoding for the TrueType font");
("-font-ttf-more",
Arg.Unit setfontttfmore,
" Signal that more text is coming for this font");
("-font-size", ("-font-size",
Arg.Float setfontsize, Arg.Float setfontsize,
" Set the font size"); " Set the font size");