gitlabEdit

crownFiglet 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.

chevron-rightAvailable functionshashtag

You can use one of the following functions:

Function
Description

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

chevron-rightExample of printing Figlet text to the console using FigletToolshashtag

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);
chevron-rightExample of printing Figlet text to the console using the font instancehashtag

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