From 71fb6b0594662301206e9b7ccd46f077179c7098 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Mon, 15 Nov 2021 17:42:17 -0800 Subject: [PATCH] Beginning simple typesetter --- Makefile | 2 +- cpdftype.ml | 15 +++++++++++++++ cpdftype.mli | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 cpdftype.ml create mode 100644 cpdftype.mli diff --git a/Makefile b/Makefile index bc4bfa3..0b982e2 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Build the cpdf command line tools and top level MODS = cpdfyojson cpdfxmlm \ cpdfunicodedata cpdferror cpdfjson cpdfstrftime cpdfcoord cpdfattach \ - cpdfpagespec cpdfposition cpdf cpdffont cpdfcommand + cpdfpagespec cpdfposition cpdf cpdffont cpdftype cpdfcommand SOURCES = $(foreach x,$(MODS),$(x).ml $(x).mli) cpdfcommandrun.ml diff --git a/cpdftype.ml b/cpdftype.ml new file mode 100644 index 0000000..6f0509e --- /dev/null +++ b/cpdftype.ml @@ -0,0 +1,15 @@ +(* cpdftype.ml *) +type box = + Text of string +| Glue of float +| Newline +| Font of string +| BoldOn +| BoldOff +| ItalicOn +| ItalicOff + +type t = box list + +let typeset papersize boxes = + [Pdfpage.blankpage papersize] diff --git a/cpdftype.mli b/cpdftype.mli new file mode 100644 index 0000000..6ff1fb9 --- /dev/null +++ b/cpdftype.mli @@ -0,0 +1,14 @@ +(* Simple typesetter *) +type box = + Text of string +| Glue of float +| Newline +| Font of string +| BoldOn +| BoldOff +| ItalicOn +| ItalicOff + +type t = box list + +val typeset : Pdfpaper.t -> t -> Pdfpage.t list