Restore plain fonts to -add-text

This commit is contained in:
John Whitington 2023-07-20 14:22:13 +01:00
parent ce7db5350a
commit da08260313
1 changed files with 3 additions and 1 deletions

View File

@ -357,6 +357,7 @@ let addtext
let newresources = let newresources =
match fontpack with match fontpack with
| Some fontpack -> | Some fontpack ->
Printf.printf "New resources: a fontpack!\n";
let newfontdict = let newfontdict =
let fd = ref fontdict in let fd = ref fontdict in
iter2 iter2
@ -368,6 +369,7 @@ let addtext
in in
Pdf.add_dict_entry resources' "/Font" newfontdict Pdf.add_dict_entry resources' "/Font" newfontdict
| None -> | None ->
Printf.printf "New resources: no fontpack!\n";
match font with match font with
| Some (Pdftext.StandardFont _ as font) -> | Some (Pdftext.StandardFont _ as font) ->
let newfontdict = let newfontdict =
@ -472,7 +474,7 @@ let
let font, fontpack = let font, fontpack =
match cpdffont with match cpdffont with
| Cpdfembed.PreMadeFontPack f -> | Cpdfembed.PreMadeFontPack f ->
Some (hd (fst f)), Some f Some (hd (fst f)), None
| Cpdfembed.EmbedInfo {fontfile; fontname; encoding} -> | Cpdfembed.EmbedInfo {fontfile; fontname; encoding} ->
let embedded = Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints:(map fst (list_of_hashtbl used)) ~encoding in let embedded = Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints:(map fst (list_of_hashtbl used)) ~encoding in
Some (hd (fst embedded)), Some embedded Some (hd (fst embedded)), Some embedded