deanm/plask — Issue #13: Cannot draw text after calling SkCanvas.writePDF()
Author: notlion
Created: 2011-10-26 23:26:07+00:00
State: open

Any text that is drawn after calling `writePDF()` will not appear in PDFs generated by subsequent calls to `writePDF()`.

Try this demo sketch to reproduce:

```javascript
var plask = require("plask");

var pdf = plask.SkCanvas.createForPDF(500, 500);
var paint = new plask.SkPaint();
paint.setStrokeWidth(10);
paint.setFontFamily("Myriad Pro");
paint.setTextSize(36);

for(var t, i = 0; i < 10; ++i){
t = i / 9;
paint.setColor(t * 255, 0, 0, 255);
pdf.save();
pdf.translate(plask.lerp(100, pdf.width - 100, t), 100);
pdf.drawLine(paint, 0, 0, 0, pdf.height - 200);
pdf.drawText(paint, i, 0, t * (pdf.height - 200));
pdf.restore();
pdf.writePDF(__dirname + "/output_" + i + ".pdf");
}

process.exit();
```

The desired outcome should be 10 lines with numbers from 0 to 9 in the final .pdf, but only the first number is drawn.

It's very possible this could be a Skia bug as well, but I'm posting here first just in case. Any idea what could be the cause?