diff --git a/pitfall/pitfall/test/out.bin b/pitfall/pitfall/test/out.bin index 2870701f..cedbe02c 100644 Binary files a/pitfall/pitfall/test/out.bin and b/pitfall/pitfall/test/out.bin differ diff --git a/pitfall/pitfall/test/test17rkt.pdf b/pitfall/pitfall/test/test17rkt.pdf index 992de21a..e69de29b 100644 Binary files a/pitfall/pitfall/test/test17rkt.pdf and b/pitfall/pitfall/test/test17rkt.pdf differ diff --git a/pitfall/pitfall/test/test18.coffee b/pitfall/pitfall/test/test18.coffee new file mode 100644 index 00000000..c84ab964 --- /dev/null +++ b/pitfall/pitfall/test/test18.coffee @@ -0,0 +1,24 @@ +PDFDocument = require 'pdfkit' +fs = require 'fs' + +make = (doc) -> + + # Register a font name for use later + doc.registerFont('the-font', 'assets/fira.ttf') + + # Set the font, draw some text + doc.font('the-font') + .fontSize(25) + .text('In Xanadu did Kubla Khan', 100, 100, {width: false}) + .text('A stately pleasure dome decree:', 100, 140, {width: false}) + .text('Where Alph, the sacred river, ran', 100, 180, {width: false}) + .text('Through caverns measureless to man', 100, 220, {width: false}) + .text('Down to a sunless sea.', 100, 260, {width: false}) + + doc.end() + + +doc = new PDFDocument({compress: no}) +doc.pipe(fs.createWriteStream('test18.pdf')) +make doc + diff --git a/pitfall/pitfall/test/test18.pdf b/pitfall/pitfall/test/test18.pdf new file mode 100644 index 00000000..ae4cb4d4 Binary files /dev/null and b/pitfall/pitfall/test/test18.pdf differ diff --git a/pitfall/pitfall/test/test18.rkt b/pitfall/pitfall/test/test18.rkt new file mode 100644 index 00000000..74f78be5 --- /dev/null +++ b/pitfall/pitfall/test/test18.rkt @@ -0,0 +1,26 @@ +#lang pitfall/pdftest + +;; multiple lines + +(define-runtime-path ttf-path "assets/fira.ttf") + +(define (proc doc) + ;; Register a font name for use later + (send doc registerFont "the-font" (path->string ttf-path)) + + ;; Set the font, draw some text + (send* doc + [font "the-font"] + [fontSize 25] + [text "In Xanadu did Kubla Khan" 100 100 (hash 'width #f)] + [text "A stately pleasure dome decree:" 100 140 (hash 'width #f)] + [text "Where Alph, the sacred river, ran" 100 180 (hash 'width #f)] + [text "Through caverns measureless to man" 100 220 (hash 'width #f)] + [text "Down to a sunless sea." 100 260 (hash 'width #f)])) + + +(define-runtime-path this "test18rkt.pdf") +(make-doc this #f proc) + +(define-runtime-path that "test18crkt.pdf") +(make-doc that #t proc #:pdfkit #f) \ No newline at end of file diff --git a/pitfall/pitfall/test/test18crkt copy.pdf b/pitfall/pitfall/test/test18crkt copy.pdf new file mode 100644 index 00000000..ef1c7fc6 Binary files /dev/null and b/pitfall/pitfall/test/test18crkt copy.pdf differ diff --git a/pitfall/pitfall/test/test18crkt.pdf b/pitfall/pitfall/test/test18crkt.pdf new file mode 100644 index 00000000..ef1c7fc6 Binary files /dev/null and b/pitfall/pitfall/test/test18crkt.pdf differ diff --git a/pitfall/pitfall/test/test18rkt copy.pdf b/pitfall/pitfall/test/test18rkt copy.pdf new file mode 100644 index 00000000..6f80eb2f Binary files /dev/null and b/pitfall/pitfall/test/test18rkt copy.pdf differ diff --git a/pitfall/pitfall/test/test18rkt.pdf b/pitfall/pitfall/test/test18rkt.pdf new file mode 100644 index 00000000..6f80eb2f Binary files /dev/null and b/pitfall/pitfall/test/test18rkt.pdf differ