1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright notice and licensing information.
// These lines indicate the copyright of the software and its licensing terms.
// SPDX-License-Identifier: Apache-2.0 OR MIT indicates dual licensing under Apache 2.0 or MIT licenses.
// Copyright © 2023-2024 LibMake. All rights reserved.
//! This module provides functionality for generating ASCII art from text using the FIGlet library.
use crateAsciiArtError;
use FIGfont;
/// 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());
/// ```
/// Loads the standard FIGfont.
///
/// # Errors
///
/// This function returns an `Err` if the standard `FIGfont` fails to load (`FontLoadError`).
///
/// # Examples
///
/// ```
/// use libmake::generators::ascii::load_standard_font;
///
/// let result = load_standard_font();
/// assert!(result.is_ok());
/// ```