let dismissed = { 'á': 'a', 'é': 'e', 'í': 'i', 'ó': 'o', 'ö': 'o', 'ő': 'o', 'ú': 'u', 'ü': 'ű' }

function draw() {
    let text = document.getElementById("msg").value.toString()
    let out = document.getElementById("outdat");
    let keys = [];
    let lines = [];
    text = text.toLowerCase();
    text = formattext(text)
    for (let i = 0; i < text.length; i++) {
        keys.push(text[i]);
    }

    for (var i = 0; i < 6; i++) {
        lines.push("");
        for (var j = 0; j < keys.length; j++) {
            lines[i] += font[text[j]][i];
        }
    }
    out.textContent = "";
    for (i in lines) {
        out.textContent += lines[i] + "\n"
    }
}

function formattext(text) {
    let text2 = "";
    for (i in text) {
        if (text[i] in dismissed) {
            text2 += dismissed[text[i]];
        } else {
            text2 += text[i]
        }
    }
    return text2;
}