From 84841250eb21c7a3f6068aa35bc2d00321a09ac7 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Mon, 31 Jan 2022 12:36:31 +0000 Subject: [PATCH] Fix font choosing regression in v2.5 --- cpdfcommand.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpdfcommand.ml b/cpdfcommand.ml index fd7f09f..1114f90 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -1095,7 +1095,11 @@ let setfont f = | Some x -> StandardFont x | None -> OtherFont (convert f) end; - args.fontname <- convert f + args.fontname <- + begin match Pdftext.standard_font_of_name ("/" ^ f) with + | Some x -> f + | None -> convert f + end let setextracttextfontsize f = args.extract_text_font_size <- Some f