use fira instead
parent
c4da0e41ae
commit
04e07329eb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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))
|
Binary file not shown.
Loading…
Reference in New Issue