Add setting of font to cpdfdrawcontrol

This commit is contained in:
John Whitington 2023-09-27 17:02:22 +01:00
parent 488d3c652e
commit df85eb1740
3 changed files with 6 additions and 0 deletions

View File

@ -1827,6 +1827,8 @@ let setdraw () =
let () = Cpdfdrawcontrol.getfontname := fun () -> args.fontname
let () = Cpdfdrawcontrol.getfontsize := fun () -> args.fontsize
let () = Cpdfdrawcontrol.setfontname := setfont
let () = Cpdfdrawcontrol.setfontsize := fun s -> args.fontsize <- s
(* Parse a control file, make an argv, and then make Arg parse it. *)
let rec make_control_argv_and_parse filename =

View File

@ -5,6 +5,8 @@ open Cpdferror
let embed_font = ref (fun () -> Cpdfembed.ExistingNamedFont)
let getfontname = ref (fun () -> "")
let getfontsize = ref (fun () -> 0.)
let setfontname = ref (fun _ -> ())
let setfontsize = ref (fun _ -> ())
let ttfs = null_hash ()

View File

@ -1,6 +1,8 @@
val embed_font : (unit -> Cpdfembed.cpdffont) ref
val getfontname : (unit -> string) ref
val getfontsize : (unit -> float) ref
val setfontname : (string -> unit) ref
val setfontsize : (float -> unit) ref
val ttfs : (string, (string * Cpdfembed.cpdffont)) Hashtbl.t
val fontpack_initialised : bool ref
val drawops : (string * Cpdfdraw.drawops list) list ref