This is an implementation of soft text wrapping in Lua for StarfallEx. I wrote it in December of 2023 but haven't done anything with it and I figured it was better out there than left rotting on my hard drive. This release also doubles as a blog post. This code may be used by anyone in any way they see fit without restriction. Make something cool with it... because I don't think I can.
2_wrap.lua
was my first attempt. I fell into the bad habit of using non-descriptive filenames. The code is really ugly.
3_wrap.lua
is visually identical to 2_wrap.lua
; the only difference is in the code. I cleaned up the code. It felt like night and day difference; I was quite pleased with how nice it looked afterward and was satisfied with myself. Some code has been moved into functions and the variable names are descriptive.
4_wrap.lua
renders an HTML-like document. It caches the wrapped versions to increase performance. I would have loved to make it more complete.