From 925ae38795e54706669c1e47805c183cfbc15a33 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Thu, 18 Nov 2021 16:41:42 -0800 Subject: [PATCH] more --- Makefile | 2 +- cpdftype.ml | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0b982e2..3d361bf 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ OCAMLLDFLAGS = -g all : native-code native-code-library byte-code-library top htdoc clean :: - rm -rf doc foo foo2 out.pdf out2.pdf foo.pdf decomp.pdf *.cmt *.cmti *.json test/*.pdf debug/*.pdf + rm -rf doc foo foo2 out.pdf out2.pdf foo.pdf decomp.pdf *.cmt *.cmti *.json test/*.pdf debug/*.pdf *.ps DOC_FILES = cpdferror.mli cpdfjson.mli cpdfstrftime.mli cpdfcoord.mli \ cpdfattach.mli cpdfpagespec.mli cpdfposition.mli cpdf.mli \ diff --git a/cpdftype.ml b/cpdftype.ml index 412d8a2..b6ef000 100644 --- a/cpdftype.ml +++ b/cpdftype.ml @@ -37,13 +37,16 @@ let of_utf8 = Pdftext.codepoints_of_utf8 let example = [Font (Pdftext.StandardFont (Pdftext.TimesRoman, Pdftext.WinAnsiEncoding), 12.); - Text (of_utf8 "Jackdaws love my Sphinx of Quartz. And this, this is the second sentence to provoke a line-break."); + Text (of_utf8 "Jackdaws love my Sphinx of Quartz. And this, this is the second sentence to provoke a line-break. We need rather more text than one might think in this diminutive font."); NewLine; newpara 10.; indent 72.; Font (Pdftext.StandardFont (Pdftext.TimesItalic, Pdftext.WinAnsiEncoding), 10.); Text (of_utf8 "The second paragraph"); - NewPage] + NewPage; + Font (Pdftext.StandardFont (Pdftext.TimesBold, Pdftext.WinAnsiEncoding), 10.); + Text (of_utf8 "A little too bold"); + ] type state = {mutable font : Pdftext.font option; @@ -146,9 +149,10 @@ let typeset lmargin rmargin tmargin bmargin papersize pdf i = s.xpos <- 0. | NewPage -> write_page (); + thispagefontnums := []; ops := []; - s.xpos <- 0.; - s.ypos <- 0. + s.xpos <- lmargin; + s.ypos <- tmargin in iter typeset_element i; write_page ();