diff --git a/pitfall/pitfall/alltest.rkt b/pitfall/pitfall/alltest.rkt index f40f1906..2dd04b0a 100644 --- a/pitfall/pitfall/alltest.rkt +++ b/pitfall/pitfall/alltest.rkt @@ -14,6 +14,6 @@ pitfall/test/test11 pitfall/test/test12 ; ttf subset pitfall/test/test13 ; subset with composites - pitfall/test/test14 ; Equity ttf + pitfall/test/test14 ; Fira ttf pitfall/page-test (submod pitfall/zlib test))) \ No newline at end of file diff --git a/pitfall/pitfall/test/assets/fira.ttf b/pitfall/pitfall/test/assets/fira.ttf new file mode 100644 index 00000000..4834eede Binary files /dev/null and b/pitfall/pitfall/test/assets/fira.ttf differ diff --git a/pitfall/pitfall/test/out.bin b/pitfall/pitfall/test/out.bin index 1b0f0895..6a2b7f04 100644 Binary files a/pitfall/pitfall/test/out.bin and b/pitfall/pitfall/test/out.bin differ diff --git a/pitfall/pitfall/test/test14.coffee b/pitfall/pitfall/test/test14.coffee index 5c9f61c8..4c1c5525 100644 --- a/pitfall/pitfall/test/test14.coffee +++ b/pitfall/pitfall/test/test14.coffee @@ -4,12 +4,12 @@ fs = require 'fs' make = (doc) -> # Register a font name for use later - doc.registerFont('the-font', 'assets/eqbi.ttf') + doc.registerFont('the-font', 'assets/fira.ttf') # Set the font, draw some text doc.font('the-font') .fontSize(25) - .text('Hello World', 100, 100, {width: false}) + .text('Hola Hola', 100, 100, {width: false}) doc.end() diff --git a/pitfall/pitfall/test/test14.pdf b/pitfall/pitfall/test/test14.pdf index f7e70161..009f0b67 100644 Binary files a/pitfall/pitfall/test/test14.pdf and b/pitfall/pitfall/test/test14.pdf differ diff --git a/pitfall/pitfall/test/test14.rkt b/pitfall/pitfall/test/test14.rkt index 10912049..d25d0e99 100644 --- a/pitfall/pitfall/test/test14.rkt +++ b/pitfall/pitfall/test/test14.rkt @@ -1,6 +1,6 @@ #lang pitfall/pdftest -(define-runtime-path ttf-path "assets/eqbi.ttf") +(define-runtime-path ttf-path "assets/fira.ttf") (define (proc doc) ;; Register a font name for use later @@ -10,18 +10,11 @@ (send* doc [font "the-font"] [fontSize 25] - [text "Hello World" 100 100 (hash 'width #f)])) + [text "Hola Hola" 100 100 (hash 'width #f)])) ;; test against non-subsetted font version (define-runtime-path this "test14rkt.pdf") -(make-doc this #f proc #:pdfkit #f) +(make-doc this #f proc #:pdfkit #t) (define-runtime-path that "test14crkt.pdf") (make-doc that #t proc #:pdfkit #f) - -#;(module+ test - (define doc (make-object PDFDocument)) - (send doc registerFont "Charter" (path->string charter-path)) - (send* doc [font "Charter"]) - (send doc pipe (open-output-string)) - (send doc end)) diff --git a/pitfall/pitfall/test/test14crkt copy.pdf b/pitfall/pitfall/test/test14crkt copy.pdf index 4e67cad5..19a862dc 100644 Binary files a/pitfall/pitfall/test/test14crkt copy.pdf and b/pitfall/pitfall/test/test14crkt copy.pdf differ diff --git a/pitfall/pitfall/test/test14crkt.pdf b/pitfall/pitfall/test/test14crkt.pdf index 4e67cad5..19a862dc 100644 Binary files a/pitfall/pitfall/test/test14crkt.pdf and b/pitfall/pitfall/test/test14crkt.pdf differ diff --git a/pitfall/pitfall/test/test14rkt copy.pdf b/pitfall/pitfall/test/test14rkt copy.pdf index 370d250d..a2e57e9f 100644 Binary files a/pitfall/pitfall/test/test14rkt copy.pdf and b/pitfall/pitfall/test/test14rkt copy.pdf differ diff --git a/pitfall/pitfall/test/test14rkt.pdf b/pitfall/pitfall/test/test14rkt.pdf index 370d250d..a2e57e9f 100644 Binary files a/pitfall/pitfall/test/test14rkt.pdf and b/pitfall/pitfall/test/test14rkt.pdf differ diff --git a/pitfall/pitfall/test/test15.coffee b/pitfall/pitfall/test/test15.coffee new file mode 100644 index 00000000..204591b8 --- /dev/null +++ b/pitfall/pitfall/test/test15.coffee @@ -0,0 +1,20 @@ +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('ATAVATA', 100, 100, {width: false}) + + doc.end() + + +doc = new PDFDocument({compress: no}) +doc.pipe(fs.createWriteStream('test15.pdf')) +make doc + diff --git a/pitfall/pitfall/test/test15.pdf b/pitfall/pitfall/test/test15.pdf new file mode 100644 index 00000000..a0eb0757 Binary files /dev/null and b/pitfall/pitfall/test/test15.pdf differ diff --git a/pitfall/pitfall/test/test15.rkt b/pitfall/pitfall/test/test15.rkt new file mode 100644 index 00000000..10912049 --- /dev/null +++ b/pitfall/pitfall/test/test15.rkt @@ -0,0 +1,27 @@ +#lang pitfall/pdftest + +(define-runtime-path ttf-path "assets/eqbi.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 "Hello World" 100 100 (hash 'width #f)])) + +;; test against non-subsetted font version +(define-runtime-path this "test14rkt.pdf") +(make-doc this #f proc #:pdfkit #f) + +(define-runtime-path that "test14crkt.pdf") +(make-doc that #t proc #:pdfkit #f) + +#;(module+ test + (define doc (make-object PDFDocument)) + (send doc registerFont "Charter" (path->string charter-path)) + (send* doc [font "Charter"]) + (send doc pipe (open-output-string)) + (send doc end)) diff --git a/pitfall/pitfall/test/test15rkt.pdf b/pitfall/pitfall/test/test15rkt.pdf new file mode 100644 index 00000000..74b79659 Binary files /dev/null and b/pitfall/pitfall/test/test15rkt.pdf differ