You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
507 B
CoffeeScript
24 lines
507 B
CoffeeScript
8 years ago
|
PDFDocument = require 'pdfkit'
|
||
|
fs = require 'fs'
|
||
|
|
||
7 years ago
|
# test ss03 (alternate ampersand form)
|
||
|
|
||
8 years ago
|
make = (doc) ->
|
||
|
|
||
|
# Register a font name for use later
|
||
7 years ago
|
doc.registerFont('the-font', 'assets/fira.ttf')
|
||
8 years ago
|
|
||
|
# Set the font, draw some text
|
||
|
doc.font('the-font')
|
||
|
.fontSize(100)
|
||
7 years ago
|
.text('A&B', 100, 100, {width: false})
|
||
|
.text('X&Y', 100, 200, {width: false, features: ["ss03"]})
|
||
8 years ago
|
|
||
|
doc.end()
|
||
|
|
||
|
|
||
|
doc = new PDFDocument({compress: no})
|
||
|
doc.pipe(fs.createWriteStream('test19.pdf'))
|
||
|
make doc
|
||
|
|