From 9bc5a611c556171e5a5bc0927e1b55be05a0bcf6 Mon Sep 17 00:00:00 2001
From: John Whitington <john@coherentgraphics.co.uk>
Date: Tue, 27 Jun 2023 15:54:15 +0100
Subject: [PATCH] Restore -typeset behaviour

---
 cpdfmanual.pdf   | Bin 392993 -> 392993 bytes
 cpdftexttopdf.ml |   3 ++-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/cpdfmanual.pdf b/cpdfmanual.pdf
index 492ba8ca896cbf7457f506e529ef3df8c5e11f6e..042885eada9b9f11fc9a2bb0bcfe79a3c7be6592 100644
GIT binary patch
delta 120
zcmZ4ZPkiA&@rD-07N!>F7M3lnk6*Ey8=4xK8d*+%^@>#n#@WvMn$?oc+0f0&z|z^&
mz{1SY&B@u^%*ou%#nIWw#K6ea1te*wU_(gB_Rf#2Gk5{gBqF*1

delta 120
zcmZ4ZPkiA&@rD-07N!>F7M3lnk6*DH8k!m#o0v|2^@>#n#@WvMn$?oc*~r+@)zQh^
p+|<n6#njZ*+{xI;(bdJ-(%jj|)xy%q)K0;Mkdp14A6aMc0sz8{B3b|d

diff --git a/cpdftexttopdf.ml b/cpdftexttopdf.ml
index 64c9d33..799e25d 100644
--- a/cpdftexttopdf.ml
+++ b/cpdftexttopdf.ml
@@ -10,7 +10,7 @@ let rec of_utf8_with_newlines fontpack fontsize t =
       (fun u ->
          match Cpdfembed.get_char fontpack u with
          | Some (c, n, f) ->
-             Printf.printf "Charcode %i, font number %i\n" c n;
+             (*Printf.printf "Charcode %i, font number %i\n" c n;*)
              begin if n <> !currfont then
                begin
                  if !currtext <> [] then items := Cpdftype.Text (rev !currtext)::!items;
@@ -33,6 +33,7 @@ let rec of_utf8_with_newlines fontpack fontsize t =
            let c = rev !buf in
              if c <> [] then process_codepoints c;
              items := Cpdftype.NewLine::!items;
+             currtext := [];
              buf := []
        | 13 (*'\r'*) -> ()
        | x ->