fText, the text formatting library
Posted: Sat Jul 13, 2019 7:20 pm
Releases now being kept at https://github.com/demonnic/fText/releases.
I'm keeping the xml package for this on my github at https://github.com/demonnic/MiscMudlet under the name fText.xml .
I've moved the documentation to the wiki. Updating the forum post is a pain in the butt, and I just feel more comfortable trying to document and give examples for this sort of thing on the wiki. So, for documentation, go here: https://github.com/demonnic/fText/wiki
Some of you may be familiar with this thing I made a while back for formatting text. I named it 'align' and wrote it completely in the global namespace which, looking back, I regret. Someone recently asked about some updates to it, and I looked over the code, and I was embarrassed. So I rewrote the whole thing, and included word wrapping of a sort.
It also has a reusable formatter object, which keeps internal track of its formatting options so you can use it to format any text the same way over and over.
It now also has a tablemaker, allowing you to make spreedsheat like tables to display information in a miniconsole or in your main console.
Now! It has some limitations. You shouldn't try to control the color inside of the string you're formatting if you're going to do wordwrapping yet. I intend to do that eventually but right now it just isn't going to work very well. I provide options for coloring the caps, spacers, and text in the meantime. And I'm only stripping the c| form of hex coloring from strings for the purposes of determining the string's actual length... I haven't figured out the pattern for doing that and # both yet. I imagine that will go in around the same time as I handle maintaining color instructions inside the string being passed for formatting.
And now, some pictures just generally showing what it can do.
I'm keeping the xml package for this on my github at https://github.com/demonnic/MiscMudlet under the name fText.xml .
I've moved the documentation to the wiki. Updating the forum post is a pain in the butt, and I just feel more comfortable trying to document and give examples for this sort of thing on the wiki. So, for documentation, go here: https://github.com/demonnic/fText/wiki
Some of you may be familiar with this thing I made a while back for formatting text. I named it 'align' and wrote it completely in the global namespace which, looking back, I regret. Someone recently asked about some updates to it, and I looked over the code, and I was embarrassed. So I rewrote the whole thing, and included word wrapping of a sort.
It also has a reusable formatter object, which keeps internal track of its formatting options so you can use it to format any text the same way over and over.
It now also has a tablemaker, allowing you to make spreedsheat like tables to display information in a miniconsole or in your main console.
Now! It has some limitations. You shouldn't try to control the color inside of the string you're formatting if you're going to do wordwrapping yet. I intend to do that eventually but right now it just isn't going to work very well. I provide options for coloring the caps, spacers, and text in the meantime. And I'm only stripping the c| form of hex coloring from strings for the purposes of determining the string's actual length... I haven't figured out the pattern for doing that and # both yet. I imagine that will go in around the same time as I handle maintaining color instructions inside the string being passed for formatting.
And now, some pictures just generally showing what it can do.