-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[harfbuzzjs] update to track branch of pull harfbuzz/harfbuzzjs#97 as…
… it adds support for features to shape.
- Loading branch information
1 parent
7253ee0
commit 55bb183
Showing
6 changed files
with
275 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
/* jshint esversion:6, browser: true */ | ||
import hbjs from './hbjs.mjs'; | ||
import hb from './hb.mjs'; | ||
|
||
// no good way to load wasm from within a module yet. | ||
const wasmURL = new URL('hb.wasm', import.meta.url); | ||
|
||
export default async function getHarfbuzz(){ | ||
let result = await fetch(wasmURL) | ||
, moduleData = await result.arrayBuffer() | ||
, wasm = await WebAssembly.instantiate(moduleData) | ||
; | ||
export default async function getHarfbuzz() { | ||
function locateFile(/*path, prefix*/) { | ||
return wasmURL.toString(); | ||
} | ||
const Module = await hb({locateFile}); | ||
// Seems like no longer required, since compiled with em++ | ||
// wasm.instance.exports.memory.grow(400); // each page is 64kb in size | ||
return hbjs(wasm.instance); | ||
return {hbjs: hbjs(Module), Module}; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.