This commit is contained in:
John Whitington 2021-11-18 16:41:42 -08:00
parent b5977ae65e
commit 925ae38795
2 changed files with 9 additions and 5 deletions

View File

@ -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 \

View File

@ -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 ();