From 748939ae002d9793c6b31672e01b808785778563 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Fri, 16 Sep 2022 20:10:49 +0100 Subject: [PATCH] more --- cpdfaddtext.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cpdfaddtext.ml b/cpdfaddtext.ml index 43ac31a..c077ed0 100644 --- a/cpdfaddtext.ml +++ b/cpdfaddtext.ml @@ -560,7 +560,10 @@ let (fontsize *. float (Pdfstandard14.baseline_adjustment font)) /. 1000. in voffset := !voffset +. baseline_adjustment - | _ -> () + | Some (Pdftext.SimpleFont {fontdescriptor = Some {capheight}}) -> + voffset := !voffset +. capheight /. 2. + | _ -> + Printf.eprintf "Unable to find midline adjustment in this font\n" end else if topline then @@ -570,7 +573,10 @@ let (fontsize *. float (Pdfstandard14.baseline_adjustment font) *. 2.0) /. 1000. in voffset := !voffset +. baseline_adjustment - | _ -> () + | Some (Pdftext.SimpleFont {fontdescriptor = Some {capheight}}) -> + voffset := !voffset +. capheight + | _ -> + Printf.eprintf "Unable to find midline adjustment in this font\n" end else iter