Commit Graph

12527 Commits

Author SHA1 Message Date
Behdad Esfahbod fe557e2f21 [wasm-api] Bind font_get_glyph_extents
Untested.
2023-03-31 17:33:44 -06:00
Behdad Esfahbod b3b6e8da86 [wasm-api] Bind buffer_reverse 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 863ec70e12 [wasm-shape] Add TODO items 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 1acff90b03 [wasm-api] Bind font_glyph_to_string 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 7537d48f08 [wasm] Remove a few lingering hb_ 2023-03-31 17:33:44 -06:00
Behdad Esfahbod d7f76f30b0 [wasm-graphite] Memory cleanup 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 5738851b1c [wasm-api] Disallow "wasm" shaper in shape_with 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 2bde2f66f1 [wasm-api] Bind shape_with 2023-03-31 17:33:44 -06:00
Behdad Esfahbod a08dbf41cd [wasm-api] Bind buffer_reverse_clusters 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 0a51ed31b0 [wasm-api] Bind buffer_get_direction 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 149199ee26 [wasm-api] Bind face_get_upem 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 2d295183b8 [wasm-api] Add buffer_contents_realloc 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 07ece17495 [wasm-graphite] Initial code 2023-03-31 17:33:44 -06:00
Behdad Esfahbod ae981eec8e [graphite] Remove script handling
https://github.com/harfbuzz/harfbuzz/issues/3439#issuecomment-1442650148
2023-03-31 17:33:44 -06:00
Behdad Esfahbod 5ab7f7a7d4 [wasm-sample] Make addTable take args 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 551528a6e6 [wasm-sample] Remove unused prototype 2023-03-31 17:33:44 -06:00
Behdad Esfahbod 926f8a326e [wasm-sample] Actually shape text! 2023-03-31 17:33:44 -06:00
Behdad Esfahbod c1dc112121 [wasm-api] Bind buffer_set_contents 2023-03-31 17:33:44 -06:00
Simon Cozens e0fec1dda0 [wasm-api] Wrap some of hb-font 2023-03-31 17:33:44 -06:00
Behdad Esfahbod af1f41a43e [wasm-api] Clear structs in _free() 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 851ef1380a [wasm-api] Add buffer-contents-free 2023-03-31 17:33:44 -06:00
Behdad Esfahbod d38f02ab30 [wasm-api] Make ref types actual pointers on the wasm side 2023-03-31 17:33:44 -06:00
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 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 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