Nanovg uses fontstash for really good font rendering. I tried to find fontstash in nanovg Java package but couldn't. Can someone make a native interface for fontstash? Please.
Fontstash on github: https://github.com/memononen/fontstash
I'm not a C developer, but I think I can help somehow.
Have you tried stb_truetype's texture packing functionality? LWJGL also has stb_rect_pack bindings.