diff --git a/cpdfaddtext.ml b/cpdfaddtext.ml index c28d370..5812b9d 100644 --- a/cpdfaddtext.ml +++ b/cpdfaddtext.ml @@ -435,7 +435,7 @@ let | Cpdfembed.EmbedInfo {fontfile; fontname; encoding} -> let embedded = Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints:[] ~encoding in Some (hd (fst embedded)) - | Cpdfembed.ExistingNamedFont _ -> None + | Cpdfembed.ExistingNamedFont -> None in let fontpdfobj = match font with diff --git a/cpdfcommand.ml b/cpdfcommand.ml index de5e99b..dcae226 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -3076,7 +3076,7 @@ let embed_font () = PreMadeFontPack (fontpack_of_standardfont (Pdftext.StandardFont (f, args.fontencoding))) end | OtherFont f -> - ExistingNamedFont f + ExistingNamedFont | FontToEmbed fontfile -> EmbedInfo {fontfile; fontname = args.fontname; encoding = args.fontencoding} diff --git a/cpdfembed.ml b/cpdfembed.ml index 17cd493..228c4d3 100644 --- a/cpdfembed.ml +++ b/cpdfembed.ml @@ -6,7 +6,7 @@ type t = Pdftext.font list * (int, int * int) Hashtbl.t (* Table returns font nu type cpdffont = PreMadeFontPack of t | EmbedInfo of {fontfile : Pdfio.bytes; fontname : string; encoding : Pdftext.encoding} -| ExistingNamedFont of string +| ExistingNamedFont let get_char (fonts, table) u = match Hashtbl.find table u with diff --git a/cpdfembed.mli b/cpdfembed.mli index 1897371..1375a6b 100644 --- a/cpdfembed.mli +++ b/cpdfembed.mli @@ -13,7 +13,7 @@ type t = Pdftext.font list * (int, int * int) Hashtbl.t type cpdffont = PreMadeFontPack of t | EmbedInfo of {fontfile : Pdfio.bytes; fontname : string; encoding : Pdftext.encoding} -| ExistingNamedFont of string +| ExistingNamedFont val get_char : t -> int -> (int * int * Pdftext.font) option diff --git a/cpdftexttopdf.ml b/cpdftexttopdf.ml index 4960d86..fe6dec8 100644 --- a/cpdftexttopdf.ml +++ b/cpdftexttopdf.ml @@ -42,7 +42,7 @@ let typeset ~papersize ~font ~fontsize text = | Cpdfembed.EmbedInfo {fontfile; fontname; encoding} -> let embedded = Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints ~encoding in (hd (fst embedded), embedded) - | Cpdfembed.ExistingNamedFont _ -> raise (Pdf.PDFError "Can't use existing named font for text-to-PDF") + | Cpdfembed.ExistingNamedFont -> raise (Pdf.PDFError "Can't use existing named font for text-to-PDF") in let instrs = of_utf8_with_newlines fontpack (Pdfio.string_of_bytes text) in let margin = diff --git a/cpdftoc.ml b/cpdftoc.ml index 303a97a..d9d5583 100644 --- a/cpdftoc.ml +++ b/cpdftoc.ml @@ -48,7 +48,7 @@ let typeset_table_of_contents ~font ~fontsize ~title ~bookmark pdf = | Cpdfembed.PreMadeFontPack t -> hd (fst t) | Cpdfembed.EmbedInfo {fontfile; fontname; encoding} -> hd (fst (Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints ~encoding)) - | Cpdfembed.ExistingNamedFont _ -> raise (Pdf.PDFError "Cannot use existing font with -table-of-contents") + | Cpdfembed.ExistingNamedFont -> raise (Pdf.PDFError "Cannot use existing font with -table-of-contents") in let marks = Pdfmarks.read_bookmarks pdf in if marks = [] then (Printf.eprintf "No bookmarks, not making table of contents\n%!"; pdf) else