Figlet Text
Figlet text makes your text look more awesome!
As part of the main Textify library, you can write figlet text using one of the 550+ fonts provided with the library!
Usage
You can use the Figlet tools using the FigletTools class in the Textify.Data.Figlet namespace.
Available functions
You can use one of the following functions:
GetByName()
Gets a Figlet font instance from name
TryGetByName()
Tries to get the Figlet font instance from name
GetFigletFonts()
Gets a list of supported Figlet fonts and their instances
GetFigletFont()
Gets a Figlet font instance from name but with fallback to small if the font is not found
Example of printing Figlet text to the console using FigletTools
This feature is easy to use. Just call the Console.WriteLine() function with FigletTools.RenderFiglet(), passing the text and the figlet font name (case sensitive):
string figletText = FigletTools.RenderFiglet("Hello!", "banner");
Console.WriteLine(figletText);Example of printing Figlet text to the console using the font instance
You can get the Figlet font instance using a function that we've mentioned earlier.
After you get the instance, you can call the Render() function on it, passing the text as the first argument.
var fontInstance = FigletTools.TryGetByName(fontName);
if (fontInstance is null)
{
Console.Error.WriteLine($"Font {fontName} not found. Exiting...");
return;
}
string rendered = fontInstance.Render(message);
Console.WriteLine(rendered);Last updated