generate_ascii_art

Function generate_ascii_art 

Source
pub fn generate_ascii_art(text: &str) -> Result<String, AsciiArtError>
Expand description

Generates ASCII art from the given text using the standard FIGfont.

§Arguments

  • text - The text to convert to ASCII art.

§Errors

This function returns an Err in the following situations:

  • If the input text is empty (ConversionError).
  • If the standard FIGfont fails to load (FontLoadError).
  • If the text cannot be converted to ASCII art (ConversionError).

§Examples

use libmake::generators::ascii::generate_ascii_art;

let text = "Hello, world!";
let result = generate_ascii_art(text);
assert!(result.is_ok());