From 4482e119165131c9bd9bff96a66c0458f8835a51 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 4 Oct 2023 15:27:59 +0100 Subject: [PATCH] Scaffolding for loadttf --- cpdfcommand.ml | 2 +- cpdfdrawcontrol.ml | 2 ++ cpdfdrawcontrol.mli | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 0a7fc80..44ed3c4 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -1790,7 +1790,7 @@ let setfont f = begin match Pdftext.standard_font_of_name ("/" ^ f) with | Some x -> StandardFont x | None -> - if f <> "" && hd (explode f) <> '/' then error "Custom font names must begin with /"; + if f <> "" && hd (explode f) <> '/' then error "Font not found"; OtherFont (convert f) end; args.fontname <- diff --git a/cpdfdrawcontrol.ml b/cpdfdrawcontrol.ml index 156938b..a1933b4 100644 --- a/cpdfdrawcontrol.ml +++ b/cpdfdrawcontrol.ml @@ -11,6 +11,8 @@ let setfontsize = ref (fun _ -> Printf.printf "BAD ******\n%!"; ()) let ttfs = null_hash () +let loadttf name filename = () + let fontpack_initialised = ref false let drawops = ref [("_MAIN", [])] diff --git a/cpdfdrawcontrol.mli b/cpdfdrawcontrol.mli index 11a1bdd..e73e749 100644 --- a/cpdfdrawcontrol.mli +++ b/cpdfdrawcontrol.mli @@ -5,6 +5,7 @@ val setfontname : (string -> unit) ref val setfontsize : (float -> unit) ref val setdrawing : (unit -> unit) ref val ttfs : (string, (string * Cpdfembed.cpdffont)) Hashtbl.t +val loadttf : string -> string -> unit val fontpack_initialised : bool ref val drawops : (string * Cpdfdraw.drawops list) list ref val addop : Cpdfdraw.drawops -> unit