libfive icon indicating copy to clipboard operation
libfive copied to clipboard

Custom font with SDF atlas

Open zeeyang opened this issue 4 years ago • 1 comments

I'm interested in custom font support for engraving text in my 3D models. https://github.com/Chlumsky/msdfgen

@mkeeter it appears oracle is meant for this type of integration. Is that correct? Can I invoke a custom oracle from python/guile or is it C++ only.

zeeyang avatar May 18 '21 16:05 zeeyang

Cool!

You're correct – this is what the oracle interface is for.

The oracle interface is C++-only, as it's very low-level; there aren't any public oracles besides basic building blocks. However, if you wanted to contribute a canonical font / msdf oracle, we could then expose that oracle in the C API and higher-level bindings.

It would probably make sense to frame it as an msdf oracle, which is more general-purpose, then have an API of something like

libfive_msdf* libfive_build_font(const char* ttf_name, float resolution, ...);
libfive_tree libfive_tree_msdf(libfive_msdf* m);

mkeeter avatar May 21 '21 21:05 mkeeter