harfbuzzjs icon indicating copy to clipboard operation
harfbuzzjs copied to clipboard

new Uint8Array(blob) versus blob

Open simoncozens opened this issue 5 years ago • 2 comments

In hbjs.js:

  function createBlob(blob) {
    var blobPtr = exports.malloc(blob.byteLength);
    heapu8.set(blob, blobPtr);

In examples/nohbjs.html:

    var fontBuffer = exports.malloc(fontBlob.byteLength);
    heapu8.set(new Uint8Array(fontBlob), fontBuffer);

I don't understand the difference but the version in nohbjs.html works in Chrome but the version in hbjs.js does not.

simoncozens avatar Jun 23 '20 06:06 simoncozens

it is okay to add a blob = new Uint8Array(blob); I think, see if that can make it always work.

ebraminio avatar Jun 23 '20 09:06 ebraminio

Is this still an issue?

khaledhosny avatar Sep 19 '20 13:09 khaledhosny