revue 2.71.1

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

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

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

    lines.join("\n")
}

/// Get mini-style glyph for a character
fn mini_char(ch: char) -> [&'static str; 3] {
    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' => ["▀▀█", "", "█▀▀"],
        '0' => ["▄█▄", "█ █", "▀▀▀"],
        '1' => ["▄█", "", "▀▀"],
        '2' => ["▀█▄", "▄█▀", "▀▀▀"],
        '3' => ["▀█▄", " █▄", "▀▀ "],
        '4' => ["█ █", "▀▀█", ""],
        '5' => ["█▀▀", "▀█▄", "▀▀ "],
        '6' => ["▄█▀", "██▄", "▀▀ "],
        '7' => ["▀▀█", "", ""],
        '8' => ["▄█▄", "▀█▀", "▀▀▀"],
        '9' => ["▄█▄", "▀▀█", "▀▀ "],
        ' ' => [" ", " ", " "],
        '!' => ["", " ", ""],
        '?' => ["▀█", "", ""],
        '.' => [" ", " ", ""],
        '-' => ["  ", "▀▀", "  "],
        _ => ["", "", ""],
    }
}