First TTF / cpdflibn example working

This commit is contained in:
John Whitington 2023-10-04 15:59:52 +01:00
parent 4482e11916
commit b21d90f000
3 changed files with 6 additions and 2 deletions

View File

@ -1821,6 +1821,8 @@ let loadttf n =
with with
_ -> error "addtff: could not load TTF" _ -> error "addtff: could not load TTF"
let () = Cpdfdrawcontrol.loadttf := loadttf
let setstderrtostdout () = let setstderrtostdout () =
Pdfe.logger := (fun s -> print_string s; flush stdout) Pdfe.logger := (fun s -> print_string s; flush stdout)

View File

@ -8,10 +8,11 @@ let getfontname = ref (fun () -> Printf.printf "BAD ***\n%!"; "")
let getfontsize = ref (fun () -> Printf.printf "BAD ****\n%!"; 0.) let getfontsize = ref (fun () -> Printf.printf "BAD ****\n%!"; 0.)
let setfontname = ref (fun _ -> Printf.printf "BAD *****\n%!"; ()) let setfontname = ref (fun _ -> Printf.printf "BAD *****\n%!"; ())
let setfontsize = ref (fun _ -> Printf.printf "BAD ******\n%!"; ()) let setfontsize = ref (fun _ -> Printf.printf "BAD ******\n%!"; ())
let loadttf = ref (fun _ -> Printf.printf "BAD *******\n%!"; ())
let ttfs = null_hash () let ttfs = null_hash ()
let loadttf name filename = () let loadttfseparate name filename = !loadttf (name ^ "=" ^ filename)
let fontpack_initialised = ref false let fontpack_initialised = ref false

View File

@ -5,7 +5,8 @@ val setfontname : (string -> unit) ref
val setfontsize : (float -> unit) ref val setfontsize : (float -> unit) ref
val setdrawing : (unit -> unit) ref val setdrawing : (unit -> unit) ref
val ttfs : (string, (string * Cpdfembed.cpdffont)) Hashtbl.t val ttfs : (string, (string * Cpdfembed.cpdffont)) Hashtbl.t
val loadttf : string -> string -> unit val loadttf : (string -> unit) ref
val loadttfseparate : string -> string -> unit
val fontpack_initialised : bool ref val fontpack_initialised : bool ref
val drawops : (string * Cpdfdraw.drawops list) list ref val drawops : (string * Cpdfdraw.drawops list) list ref
val addop : Cpdfdraw.drawops -> unit val addop : Cpdfdraw.drawops -> unit