use fira instead

main
Matthew Butterick 8 years ago
parent c4da0e41ae
commit 04e07329eb

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

Binary file not shown.

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

Binary file not shown.

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

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

Binary file not shown.

@ -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))
Loading…
Cancel
Save