decktape: Error: Read ttf table data error at `2.11.0`

$ npx decktape remark index.html slide.pdf --chrome-arg=--disable-web-security
Loading page file:///Users/myid/slide/index.html ...
800 600
{ skip... }
0
[ 'page-10' ]
Loading page finished with status: 0
Remark JS plugin activated
Printing slide #1       ( 1/33) ...{ skip... }
...skip...
Printing slide #7       ( 7/33) ...
Error: Read ttf table data error
Time: 0h:00m:10s

Above example, decktape latest version 2.11.0 is used. But When I fix the decktape version to 2.10.0, it works well.

$ yarn add decktape@2.10.0
$ npx decktape remark index.html slide.pdf --chrome-arg=--disable-web-security

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 22 (7 by maintainers)

Most upvoted comments

@peterj ok, thanks. I’ll work on it ASAP.

Thanks for the report. It’s likely related to the fonteditor-core upgrade done in 2.11.0.

Would you be able to share a presentation so that we can reproduce?

Decktape reads the fonts from the PDF stream returned by Puppeteer, directly in memory.

I’ve just given it a deeper look, and it turns out the font written in the PDF, in the Helvetica Neue case, does not have a cmap table, which prevent fonteditor-core (or any other libraries I’ve tested, e.g., fontkit, opentype.js) from being able to parse it.

My current understanding is that the root cause lies in Puppeteer > Chromium > Skia. In the meantime, I’ve created #278 as a work-around, that simply skips font compression for such ill-formed fonts.

The problem occurs reliably with Helvetica Neue, perhaps the specific ttf distributed with macOS.

This in a presentation suffices to trigger the problem:

<div style="font-family: 'Helvetica Neue';">crash</div>

(I discovered this by trying to include https://www.tmwr.org/premade/modeling-process.svg in a presentation.)

2.10.0 works for me, but 2.11.0 throws the same error as in the title. I wish I could help more, but I am not very familiar with JS to debug the problem.