Comment by aleyan

6 hours ago

Great work! While I was building ascii-side-of-the-moon [0][1] I briefly considered writing my own ascii renderer to capture differences in shade and shape of the Lunar Maria[2] better. Ended up just using chafa [3] with the hope of coming back to ascii rendering after everything is working end to end.

Are you planning to release this as a library or a tool, or should we just take the relevant MIT licensed code from your website [4]?

[0] https://github.com/alexharri/website/tree/master/src

The ASCII moon tool is fun to play around with!

No plans to build a library right now, but who knows. Feel free to grab what you need from the website's code!

If I were to build a library, I'd probably convert the shaders from WebGL 2 to WebGL 1 for better browser compatibility. Would also need to figure out a good API for the library.

One thing that a library would need to deal with is that the shape vector depends on the font family, so the user of the library would need to precompute the shape vectors with the input font family. The sampling circles, internal and external, would likely need to be positioned differently for different font families. It's not obvious to me how a user of the library would go about that. There'd probably need to be some tool for that (I have a script to generate the shape vectors with a hardcoded link to a font in the website repository).