opentype.js icon indicating copy to clipboard operation
opentype.js copied to clipboard

Buffer and Draw

Open benoitwimart opened this issue 5 years ago • 0 comments

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 ?

benoitwimart avatar Jun 18 '19 07:06 benoitwimart