Better font error message

This commit is contained in:
John Whitington 2022-02-13 17:57:02 +00:00
parent 1f3eb79002
commit a0e93444b9
1 changed files with 3 additions and 1 deletions

View File

@ -1093,7 +1093,9 @@ let setfont f =
args.font <- args.font <-
begin match Pdftext.standard_font_of_name ("/" ^ f) with begin match Pdftext.standard_font_of_name ("/" ^ f) with
| Some x -> StandardFont x | 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; end;
args.fontname <- args.fontname <-
begin match Pdftext.standard_font_of_name ("/" ^ f) with begin match Pdftext.standard_font_of_name ("/" ^ f) with