Beginning on fontpacks for -add-text

This commit is contained in:
John Whitington 2023-07-12 15:51:29 +01:00
parent 14bfc8b6c3
commit f5c47c926c
2 changed files with 5 additions and 3 deletions

View File

@ -523,14 +523,14 @@ let
!pdf; !pdf;
voffset := !voffset +. (linespacing *. fontsize)) voffset := !voffset +. (linespacing *. fontsize))
lines; lines;
(*begin match cpdffont with begin match cpdffont with
| Cpdfembed.EmbedInfo {fontfile; fontname; encoding} -> | Cpdfembed.EmbedInfo {fontfile; fontname; encoding} ->
let codepoints = map fst (list_of_hashtbl used) in let codepoints = map fst (list_of_hashtbl used) in
let objnum = match fontpdfobj with Pdf.Indirect i -> i | _ -> failwith "bad fontpdfobj" in let objnum = match fontpdfobj with Pdf.Indirect i -> i | _ -> failwith "bad fontpdfobj" in
let font = hd (fst (Cpdfembed.embed_truetype !pdf ~fontfile ~fontname ~codepoints ~encoding)) in let font = hd (fst (Cpdfembed.embed_truetype !pdf ~fontfile ~fontname ~codepoints ~encoding)) in
ignore (Pdftext.write_font ~objnum !pdf font) ignore (Pdftext.write_font ~objnum !pdf font)
| _ -> () | _ -> ()
end;*) end;
!pdf !pdf

View File

@ -2,6 +2,8 @@
open Pdfutil open Pdfutil
open Pdfio open Pdfio
(* FIXME revisit widths for mono font - the new code returning the notdef width is making the notdef width turn up in /Widths, where missing entries should be 0! *)
let dbg = let dbg =
(* Pdfe.logger := (fun s -> print_string s; flush stdout) *) (* Pdfe.logger := (fun s -> print_string s; flush stdout) *)
ref false ref false
@ -288,7 +290,7 @@ let write_glyf_table subset cmap bs mk_b glyfoffset loca =
Not_found -> ()) Not_found -> ())
subset; subset;
let locnums = (*expand_composites mk_b loca glyfoffset*) (sort compare (map fst (list_of_hashtbl locnums))) in let locnums = (*expand_composites mk_b loca glyfoffset*) (sort compare (map fst (list_of_hashtbl locnums))) in
(*if !dbg then*) if !dbg then
(Printf.printf "We want glyfs for locations: "; (Printf.printf "We want glyfs for locations: ";
iter (Printf.printf "%i ") locnums; Printf.printf "\n"); iter (Printf.printf "%i ") locnums; Printf.printf "\n");
let byteranges = map (fun x -> (loca.(x), loca.(x + 1))) locnums in let byteranges = map (fun x -> (loca.(x), loca.(x + 1))) locnums in