astefanutti / decktape

PDF exporter for HTML presentations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

font creation problem

srl295 opened this issue · comments

Font.create returns null/undefined here:

decktape/decktape.js

Lines 448 to 451 in 2e78896

const font = Font.create(Buffer.from(bytes), { type: 'ttf', hinting: true });
// PDF font name does not contain sub family on Windows 10 so a more robust key
// is computed from the font metadata
const id = descriptor.get(PDFName.of('FontName')).value() + ' - ' + fontMetadataKey(font.data.name);

Printing slide #66      ( 66/132) ...TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at fontMetadataKey (/Users/srl295/src/srl295-slides/node_modules/decktape/decktape.js:462:19)
    at parseFont (/Users/srl295/src/srl295-slides/node_modules/decktape/decktape.js:426:77)
    at Array.forEach (<anonymous>)
    at parseResources (/Users/srl295/src/srl295-slides/node_modules/decktape/decktape.js:387:45)
    at printSlide (/Users/srl295/src/srl295-slides/node_modules/decktape/decktape.js:378:3)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

It's slide 66 of this

char in question is a monospace snowman

Markdown:

Hello, World☃

### `Hello, World☃`

Huh… making it a non monospace snowman 'fixed' it:

### `Hello, World`

Hello, World

It should be fixed with c4914a4, that’s available in the latest 3.4.0 release.