Commit Graph

22 Commits

Author SHA1 Message Date
Behdad Esfahbod 9f8ad3928a [wasm-api] Bind shaper features 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 39f8703df1 [wasm-api] Match interface and implementation signatures 2023-03-31 17:33:44 -06:00
Behdad Esfahbod fea3ffe031 [wasm-api] Beautify internal API 2023-03-31 17:33:44 -06:00
Behdad Esfahbod a5c844a1de [wasm] Rename macro 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 23b58b5667 [wasm-api] Bind font_get_scale 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 099a0150e1 [wasm] Add HB_STRUCT_TYPE 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 3b88bd9742 [wasm-api] Make ptr_t a pointer on the wasm side 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 69b1707d82 [wasm] Return empty object when ref2obj fails 2023-03-31 17:33:44 -06:00
Behdad Esfahbod e87b1b3ec3 [wasm-api] Try to add face_reference_table 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 747dcf561d [wasm] Strong typing for object references
Such that wasm cannot crash us by passing wrong object refs.

https://github.com/bytecodealliance/wasm-micro-runtime/discussions/1987

It still is unsafe if some code in the process other than HarfBuzz
registers refs with wasm-micro-runtime, since wasm_externref_ref2obj()
takes no context variable and looks up refs globally :(.

Maybe I fix that later by keeping a hash table of ref->obj-type instead.
2023-03-31 17:33:44 -06:00
Behdad Esfahbod 42d121ae79 [wasm] Add hb-wasm-api.cc 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 980706441b [wasm] Add hb-wasm-api-list.hh 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 65efad6b59 [wasm] Make debugprint use debug API 2023-03-31 17:33:44 -06:00
Simon Cozens 36dd27bf3f Just printf, don't take length 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 62f3c7cf67 [wasm-api] Add macros for ref handling 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 4c8a414a10 [wasm-api] Clean up debugprint 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 63904538c8 [wasm-api] Use i32 instead of externref in API spec
Oh well...
2023-03-31 17:33:44 -06:00
Simon Cozens ed1a70c7e8 Only export debugprint when HB_DEBUG_WASM 2023-03-31 17:33:44 -06:00
Simon Cozens 89c50b0ccb Fix debugprint format string 2023-03-31 17:33:44 -06:00
Behdad Esfahbod fd1f7f46f4 [wasm-api] Implement font_get_face 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 9f4dc2e103 [wasm] Bind native API 2023-03-31 17:33:44 -06:00
Behdad Esfahbod e79a7318c4 [wasm] Start adding wasm-api 2023-03-31 17:33:44 -06:00