Commit Graph

15863 Commits

Author SHA1 Message Date
Behdad Esfahbod cbd5c554fb [wasm-api] Add blob_free 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 3bec8dca1c [wasm-sample] Free blob data for now 2023-03-31 17:33:44 -06:00
Behdad Esfahbod d45a13f101 [wasm] Add wasm-sample/ 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 5cecfe8659 [wasm-api] Bind buffer_copy_contents 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 50b22368d0 Revert "Fix function signature"
This reverts commit d70ebf98b0c696f3c66a20b1243cb347e3e3abc8.

Nope. A struct return is not returned that way.
2023-03-31 17:33:44 -06:00
Simon Cozens 743cd2c46e Fix function signature 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 d7a6671676 [wasm-api] Add debugprint1/2/3/4 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 108995bbc6 [wasm-api] Finish face_reference_table 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 e03726d269 [wasm] Ignore API in the docs 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 6b72a18c7b [wasm-api] Rename file 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
Behdad Esfahbod bb8a04cbad [wasm] Remove the print(returnval) and use it to fail shaper 2023-03-31 17:33:44 -06:00
Simon Cozens 11fc83c0ba [Docs] Pass a C string from Rust to HB 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 3bc0ecf28c [wasm-api] Add ref_t 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
Behdad Esfahbod bd28d01a6a [wasm-api] Add HB_WASM_INTERFACE 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
Simon Cozens f0200445d0 Initial WASM docs and Rust example 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
Behdad Esfahbod 829ba74284 [wasm] Add hb-wasm-api.h 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 11c6d46086 [wasm] Pass font & buff to shape() function 2023-03-31 17:33:44 -06:00
Simon Cozens 05bf984212 Add a simple callback native function 2023-03-31 17:33:44 -06:00
Behdad Esfahbod bdbc1568ba [wasm] Port from c_api to wasm-micro-runtime wasm_runtime API 2023-03-31 17:33:44 -06:00
Behdad Esfahbod db8e51e01b [wasm] More boilerplate 2023-03-31 17:33:44 -06:00
Behdad Esfahbod fcc8be409b [wasm] Add meson build option
Autotools support missing.
2023-03-31 17:33:44 -06:00
Behdad Esfahbod 425fc7f3ee [wasm] Add wasm shaper skeleton 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 04a47932a3 [paint] Remove enum trailing comma in C header
Fixes https://github.com/harfbuzz/harfbuzz/discussions/4188
2023-03-31 11:44:08 -06:00
Garret Rieger 2cd81fdfb6 [subset] fix memory leak.
Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/6169920089227264
2023-03-30 16:19:41 -06:00
Behdad Esfahbod 453ded0539 [indic] Tighten up base-finding
Fixes https://github.com/harfbuzz/harfbuzz/issues/4185
2023-03-28 13:18:03 -06:00
Qunxin Liu c1acfe9966 [instancer] bug fix in TupleVariationData get_size ()
We need to iterate TupleVariationHeader when calculating the total size
2023-03-27 15:37:06 -06:00
Garret Rieger be87200106 [subset] fix buffer overflow fuzzer reported issue. 2023-03-25 10:11:46 -04:00
Garret Rieger 79ae6b657f [subset] Fix fuzzer found memory leaks. 2023-03-25 10:11:46 -04:00
Qunxin Liu ab87d7d225 [instance] add tests for colrv1 full instancing 2023-03-21 11:51:58 -06:00
Qunxin Liu fe671a5ac8 [instancer] support COLRv1 full instancing 2023-03-21 11:51:58 -06:00
Garret Rieger f0f7f22525 [subset] fix fuzzer found null deref.
https://oss-fuzz.com/testcase-detail/5844352760152064
2023-03-21 11:41:09 -06:00
Garret Rieger 79233a1492 [subset] fix incorrectly specified lock.
Lock variable must have a name or it will immediately destruct.
2023-03-16 20:30:39 -06:00
Garret Rieger 8d8bcde8cf [set] don't allow -1 (HB_SET_VALUE_INVALID) to be inserted into a hb_set_t.
Add tests that check all of the addition methods.
2023-03-15 12:10:18 -06:00
Garret Rieger a84cae424d [subset] Don't add invalid gids (-1) to the glyphset when loading glyph map from the accelerator. 2023-03-15 12:10:18 -06:00