From a0e93444b9294c83601cfd00b0203184d27d2354 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Sun, 13 Feb 2022 17:57:02 +0000 Subject: [PATCH] Better font error message --- cpdfcommand.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 3e65fe7..6610241 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -1093,7 +1093,9 @@ let setfont f = args.font <- begin match Pdftext.standard_font_of_name ("/" ^ f) with | Some x -> StandardFont x - | None -> OtherFont (convert f) + | None -> + if f <> "" && hd (explode f) <> '/' then error "Custom font names must begin with /"; + OtherFont (convert f) end; args.fontname <- begin match Pdftext.standard_font_of_name ("/" ^ f) with