Chlumsky / msdfgen

Multi-channel signed distance field generator
MIT License
4.01k stars 419 forks source link

C API #58

Closed bjornbytes closed 5 years ago

bjornbytes commented 7 years ago

Is there any interest in adding a C API? I'm working on an engine written in C that uses this library and have a rudimentary C API for msdfgen in a fork. If there's interest, I could clean it up and open up a PR.

TannerRogalsky commented 6 years ago

@bjornbytes I'd be interested in that. Would make it nicer to use with LuaJIT's FFI in Love.

solenum commented 5 years ago

If anyone is still looking for a C API, I've been working on a pure C implementation of this for the past few weeks for my own C-based game engine.

It's still a bit buggy and has some work to do, but overall its working pretty well and at the very least could be used as a reference for someone else trying to implement this in C. It has zero external depends as it only relies on stb_truetype.h (which is included) to load the TTF.

https://github.com/solenum/msdf-c

bjornbytes commented 5 years ago

Great! I'm going to close this issue since it's been a while and the above implementation is available now.

radgeRayden commented 6 months ago

The implementation linked is no longer available.

solenum commented 6 months ago

@radgeRayden try now

radgeRayden commented 6 months ago

@solenum thanks, fwiw/for reference @bjornbytes linked me to his C wrapper that is relatively up-to-date: https://github.com/bjornbytes/msdfgen/tree/lovr