From 04fad2295b7c276470ed21ea6211569a8cb09f8a Mon Sep 17 00:00:00 2001 From: John Whitington Date: Fri, 21 Jul 2023 16:22:14 +0100 Subject: [PATCH] Correct -topline / -midline adjustments for TrueType fonts --- cpdfaddtext.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpdfaddtext.ml b/cpdfaddtext.ml index 68d0778..4053c24 100644 --- a/cpdfaddtext.ml +++ b/cpdfaddtext.ml @@ -529,7 +529,7 @@ let in voffset := !voffset +. baseline_adjustment | Some (Pdftext.SimpleFont {fontdescriptor = Some {capheight}}) -> - voffset := !voffset +. capheight /. 2. + voffset := !voffset +. capheight /. 2. /. 1000. | _ -> Pdfe.log "Unable to find midline adjustment in this font\n" end @@ -542,9 +542,9 @@ let in voffset := !voffset +. baseline_adjustment | Some (Pdftext.SimpleFont {fontdescriptor = Some {capheight}}) -> - voffset := !voffset +. capheight + voffset := !voffset +. capheight /. 1000. | _ -> - Pdfe.log "Unable to find midline adjustment in this font\n" + Pdfe.log "Unable to find topline adjustment in this font\n" end; let encoding = match font with