revue 2.71.1

A Vue-style TUI framework for Rust with CSS styling
Documentation
//! Small style font rendering

/// Render text in small style (5 rows)
pub fn render_small(text: &str) -> String {
    let text = text.to_uppercase();
    let mut lines = vec![String::new(); 5];

    for ch in text.chars() {
        let glyph = small_char(ch);
        for (i, line) in glyph.iter().enumerate() {
            lines[i].push_str(line);
        }
    }

    lines.join("\n")
}

/// Get small-style glyph for a character
fn small_char(ch: char) -> [&'static str; 5] {
    match ch {
        'A' => [" ▄▄ ", "█▄▄█", "█  █", "█  █", "    "],
        'B' => ["█▀▀▄", "█▀▀▄", "█▄▄▀", "    ", "    "],
        'C' => ["▄▀▀▀", "", "▀▄▄▄", "    ", "    "],
        'D' => ["█▀▀▄", "█  █", "█▄▄▀", "    ", "    "],
        'E' => ["█▀▀▀", "█▀▀ ", "█▄▄▄", "    ", "    "],
        'F' => ["█▀▀▀", "█▀▀ ", "", "    ", "    "],
        'G' => ["▄▀▀▀", "█ ▀█", "▀▄▄▀", "    ", "    "],
        'H' => ["█  █", "█▀▀█", "█  █", "    ", "    "],
        'I' => ["", "", "", " ", " "],
        'J' => ["", "", "▀▄▄▀", "    ", "    "],
        'K' => ["█ ▄▀", "██  ", "█ ▀▄", "    ", "    "],
        'L' => ["", "", "█▄▄▄", "    ", "    "],
        'M' => ["█▄ ▄█", "█ ▀ █", "█   █", "     ", "     "],
        'N' => ["█▄  █", "█ ▀▄█", "█   █", "     ", "     "],
        'O' => ["▄▀▀▄", "█  █", "▀▄▄▀", "    ", "    "],
        'P' => ["█▀▀▄", "█▄▄▀", "", "    ", "    "],
        'Q' => ["▄▀▀▄", "█  █", "▀▄▄█", "    ", "    "],
        'R' => ["█▀▀▄", "█▄▄▀", "█  █", "    ", "    "],
        'S' => ["▄▀▀▀", " ▀▀▄", "▄▄▄▀", "    ", "    "],
        'T' => ["▀█▀", "", "", "   ", "   "],
        'U' => ["█  █", "█  █", "▀▄▄▀", "    ", "    "],
        'V' => ["█  █", "▀▄▄▀", " ▀▀ ", "    ", "    "],
        'W' => ["█   █", "█ ▄ █", "▀▄▀▄▀", "     ", "     "],
        'X' => ["█ █", "", "█ █", "   ", "   "],
        'Y' => ["█ █", "", "", "   ", "   "],
        'Z' => ["▀▀▀█", " ▄▀ ", "█▄▄▄", "    ", "    "],
        ' ' => ["  ", "  ", "  ", "  ", "  "],
        _ => ["▄▄", "██", "▀▀", "  ", "  "],
    }
}