Closed jlarmstrongiv closed 1 year ago
I didn't expose the JavaScript API by default.
But all you need is to add the expected functions into the list of "-s EXPORTED_FUNCTIONS=_main, ...`.
Here is a live example:
In the above example, it exposed some Cairo functions such as: cairo_create
, cairo_reference
and cairo_destroy
.
Pango should be the same.
To know more about exposing C APIs to JavaScript, please check this:
I hope this could help.
Thank you @VitoVan ! I really appreciate the examples 😄 I’ll close this issue while I try that out
Thank you @VitoVan ! I really appreciate the examples 😄 I’ll close this issue while I try that out
I'm glad it helped.
Feel free to let me know if you encountered any problem.
Really cool that you were able to compile pango and cairo to wasm 🚀
I noticed that the pango layout is defined in https://github.com/VitoVan/pango-cairo-wasm/blob/main/hello-pangocairo.c#L112
Is there a JavaScript API for pango? It’d be great to be able to call
pango_layout
from the JS side