harfbuzz / harfbuzzjs

Providing HarfBuzz shaping library for client/server side JavaScript projects
https://harfbuzz.github.io/harfbuzzjs/
Other
204 stars 35 forks source link

Expose constants/enums? #69

Open papandreou opened 1 year ago

papandreou commented 1 year ago

Hi,

It feels a bit dirty to hardcode constants like this, especially if they're subject to change in new major versions:

Is there any way those somehow be included with harfbuzzjs?

chearon commented 1 year ago

I have had this problem with every WebAssembly project I've worked on. It does look like Emscripten has a way of exposing C++ enums and constants to JS, which could be used now that this project uses Emscripten.

khaledhosny commented 1 year ago

HarfBuzz is ABI and API stable, these values don't change across releases, even major ones.

papandreou commented 1 year ago

Okay, that makes me feel slightly less worried about hardcoding them. Still, I think it would be worth it to expose them as a pure DX/discoverability thing?

khaledhosny commented 1 year ago

Sure, if someone wants to do it.