opentype.js
opentype.js copied to clipboard
Buffer and Draw
As I understand, after made a font with code, I need to buffer this to draw()
it.
var buffer = font.toArrayBuffer();
var font2 = opentype.parse(buffer);
font2.draw(previewCtx, "AB", 0, 150, 72);
But the A and B overlap. So, I do like this, but maybe I can do it better :
font2.draw(previewCtx, "A", 0, 150, 72);
font2.draw(previewCtx, "B", 72, 150, 72);
Any idea why and how fix this ?