local letteroutlines = {
    ["0"] = {
        {
            { x = 0.00, y = 0.20 },
            { x = 0.10, y = 0.20 },
            { x = 0.10, y = 0.10 },
            { x = 0.20, y = 0.10 },
            { x = 0.20, y = 0.00 },
            { x = 0.60, y = 0.00 },
            { x = 0.60, y = 0.10 },
            { x = 0.70, y = 0.10 },
            { x = 0.70, y = 0.20 },
            { x = 0.80, y = 0.20 },
            { x = 0.80, y = 0.80 },
            { x = 0.70, y = 0.80 },
            { x = 0.70, y = 0.90 },
            { x = 0.60, y = 0.90 },
            { x = 0.60, y = 1.00 },
            { x = 0.50, y = 1.00 },
            { x = 0.50, y = 0.70 },
            { x = 0.60, y = 0.70 },
            { x = 0.60, y = 0.30 },
            { x = 0.50, y = 0.30 },
            { x = 0.50, y = 0.20 },
            { x = 0.30, y = 0.20 },
            { x = 0.30, y = 0.30 },
            { x = 0.20, y = 0.30 },
            { x = 0.20, y = 0.70 },
            { x = 0.30, y = 0.70 },
            { x = 0.30, y = 0.80 },
            { x = 0.50, y = 0.80 },
            { x = 0.50, y = 1.00 },
            { x = 0.20, y = 1.00 },
            { x = 0.20, y = 0.90 },
            { x = 0.10, y = 0.90 },
            { x = 0.10, y = 0.80 },
            { x = 0.00, y = 0.80 },
        }
    },
    ["1"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.20 },
            { x = 0.50, y = 0.20 },
            { x = 0.50, y = 1.00 },
            { x = 0.20, y = 1.00 },
            { x = 0.20, y = 0.90 },
            { x = 0.10, y = 0.90 },
            { x = 0.10, y = 0.70 },
            { x = 0.30, y = 0.70 },
            { x = 0.30, y = 0.20 },
            { x = 0.00, y = 0.20 },
        }
    },
    ["2"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.20 },
            { x = 0.40, y = 0.20 },
            { x = 0.40, y = 0.30 },
            { x = 0.50, y = 0.30 },
            { x = 0.50, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.50 },
            { x = 0.70, y = 0.50 },
            { x = 0.70, y = 0.60 },
            { x = 0.80, y = 0.60 },
            { x = 0.80, y = 0.80 },
            { x = 0.74, y = 0.80 },
            { x = 0.74, y = 0.90 },
            { x = 0.60, y = 0.90 },
            { x = 0.60, y = 1.00 },
            { x = 0.20, y = 1.00 },
            { x = 0.20, y = 0.90 },
            { x = 0.10, y = 0.90 },
            { x = 0.10, y = 0.80 },
            { x = 0.00, y = 0.80 },
            { x = 0.00, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.70 },
            { x = 0.30, y = 0.70 },
            { x = 0.30, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 0.60 },
            { x = 0.50, y = 0.60 },
            { x = 0.50, y = 0.50 },
            { x = 0.40, y = 0.50 },
            { x = 0.40, y = 0.40 },
            { x = 0.30, y = 0.40 },
            { x = 0.30, y = 0.30 },
            { x = 0.20, y = 0.30 },
            { x = 0.20, y = 0.20 },
            { x = 0.10, y = 0.20 },
            { x = 0.10, y = 0.10 },
            { x = 0.00, y = 0.10 },
        }
    },
    ["3"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 0.40 },
            { x = 0.70, y = 0.40 },
            { x = 0.70, y = 0.60 },
            { x = 0.80, y = 0.60 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
            { x = 0.00, y = 0.70 },
            { x = 0.10, y = 0.70 },
            { x = 0.10, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 0.60 },
            { x = 0.30, y = 0.60 },
            { x = 0.30, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.20 },
            { x = 0.10, y = 0.20 },
            { x = 0.10, y = 0.30 },
            { x = 0.00, y = 0.30 },
        }
    },
    ["4"] = {
        {
            { x = 0.00, y = 0.30 },
            { x = 0.50, y = 0.30 },
            { x = 0.50, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.30 },
            { x = 0.80, y = 0.30 },
            { x = 0.80, y = 0.50 },
            { x = 0.70, y = 0.50 },
            { x = 0.70, y = 1.00 },
            { x = 0.50, y = 1.00 },
            { x = 0.50, y = 0.50 },
            { x = 0.20, y = 0.50 },
            { x = 0.20, y = 0.60 },
            { x = 0.30, y = 0.60 },
            { x = 0.30, y = 0.80 },
            { x = 0.40, y = 0.80 },
            { x = 0.40, y = 1.00 },
            { x = 0.30, y = 1.00 },
            { x = 0.30, y = 0.90 },
            { x = 0.20, y = 0.90 },
            { x = 0.20, y = 0.80 },
            { x = 0.10, y = 0.80 },
            { x = 0.10, y = 0.60 },
            { x = 0.00, y = 0.60 },
        }
    },
    ["5"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 0.50 },
            { x = 0.70, y = 0.50 },
            { x = 0.70, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.80 },
            { x = 0.80, y = 0.80 },
            { x = 0.80, y = 1.00 },
            { x = 0.00, y = 1.00 },
            { x = 0.00, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.20 },
            { x = 0.00, y = 0.20 },
        }
    },
    ["6"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 0.50 },
            { x = 0.70, y = 0.50 },
            { x = 0.70, y = 0.60 },
            { x = 0.60, y = 0.60 },
            { x = 0.60, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.80 },
            { x = 0.70, y = 0.80 },
            { x = 0.70, y = 0.70 },
            { x = 0.80, y = 0.70 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
        }
    },
    ["7"] = {
        {
            { x = 0.00, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 0.60 },
            { x = 0.50, y = 0.60 },
            { x = 0.50, y = 0.50 },
            { x = 0.40, y = 0.50 },
            { x = 0.40, y = 0.40 },
            { x = 0.30, y = 0.40 },
            { x = 0.30, y = 0.00 },
            { x = 0.50, y = 0.00 },
            { x = 0.50, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.50 },
            { x = 0.70, y = 0.50 },
            { x = 0.70, y = 0.60 },
            { x = 0.80, y = 0.60 },
            { x = 0.80, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["8"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 0.40 },
            { x = 0.70, y = 0.40 },
            { x = 0.70, y = 0.60 },
            { x = 0.80, y = 0.60 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
            { x = 0.00, y = 0.60 },
            { x = 0.10, y = 0.60 },
            { x = 0.10, y = 0.40 },
            { x = 0.00, y = 0.40 },
        }
    },
    ["9"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
            { x = 0.00, y = 0.50 },
            { x = 0.10, y = 0.50 },
            { x = 0.10, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.20 },
            { x = 0.00, y = 0.20 },
        }
    },
    ["A"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.20, y = 0.00 },
            { x = 0.20, y = 0.20 },
            { x = 0.60, y = 0.20 },
            { x = 0.60, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.60 },
            { x = 0.70, y = 0.60 },
            { x = 0.70, y = 0.80 },
            { x = 0.64, y = 0.80 },
            { x = 0.64, y = 0.90 },
            { x = 0.50, y = 0.90 },
            { x = 0.50, y = 0.60 },
            { x = 0.60, y = 0.60 },
            { x = 0.60, y = 0.40 },
            { x = 0.20, y = 0.40 },
            { x = 0.20, y = 0.60 },
            { x = 0.30, y = 0.60 },
            { x = 0.30, y = 0.80 },
            { x = 0.50, y = 0.80 },
            { x = 0.50, y = 1.00 },
            { x = 0.30, y = 1.00 },
            { x = 0.30, y = 0.90 },
            { x = 0.16, y = 0.90 },
            { x = 0.16, y = 0.80 },
            { x = 0.10, y = 0.80 },
            { x = 0.10, y = 0.60 },
            { x = 0.00, y = 0.60 },
        }
    },
    ["B"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 0.50 },
            { x = 0.70, y = 0.50 },
            { x = 0.70, y = 0.60 },
            { x = 0.60, y = 0.60 },
            { x = 0.60, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.90 },
            { x = 0.50, y = 0.90 },
            { x = 0.50, y = 1.00 },
            { x = 0.40, y = 1.00 },
            { x = 0.40, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.80 },
            { x = 0.40, y = 0.80 },
            { x = 0.40, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["C"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 0.30 },
            { x = 0.60, y = 0.30 },
            { x = 0.60, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 0.70 },
            { x = 0.80, y = 0.70 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
        }
    },
    ["D"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.60, y = 0.00 },
            { x = 0.60, y = 0.10 },
            { x = 0.70, y = 0.10 },
            { x = 0.70, y = 0.20 },
            { x = 0.80, y = 0.20 },
            { x = 0.80, y = 0.80 },
            { x = 0.70, y = 0.80 },
            { x = 0.70, y = 0.90 },
            { x = 0.60, y = 0.90 },
            { x = 0.60, y = 1.00 },
            { x = 0.50, y = 1.00 },
            { x = 0.50, y = 0.70 },
            { x = 0.60, y = 0.70 },
            { x = 0.60, y = 0.30 },
            { x = 0.50, y = 0.30 },
            { x = 0.50, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.80 },
            { x = 0.50, y = 0.80 },
            { x = 0.50, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["E"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.80 },
            { x = 0.80, y = 0.80 },
            { x = 0.80, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["F"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.20, y = 0.00 },
            { x = 0.20, y = 0.40 },
            { x = 0.70, y = 0.40 },
            { x = 0.70, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.80 },
            { x = 0.80, y = 0.80 },
            { x = 0.80, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["G"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 0.60 },
            { x = 0.40, y = 0.60 },
            { x = 0.40, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.80 },
            { x = 0.80, y = 0.80 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
        }
    },
    ["H"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.20, y = 0.00 },
            { x = 0.20, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["I"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.60, y = 0.00 },
            { x = 0.60, y = 0.20 },
            { x = 0.40, y = 0.20 },
            { x = 0.40, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 1.00 },
            { x = 0.00, y = 1.00 },
            { x = 0.00, y = 0.80 },
            { x = 0.20, y = 0.80 },
            { x = 0.20, y = 0.20 },
            { x = 0.00, y = 0.20 },
        }
    },
    ["J"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.40, y = 0.00 },
            { x = 0.40, y = 0.10 },
            { x = 0.50, y = 0.10 },
            { x = 0.50, y = 0.80 },
            { x = 0.70, y = 0.80 },
            { x = 0.70, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.80 },
            { x = 0.30, y = 0.80 },
            { x = 0.30, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.30 },
            { x = 0.00, y = 0.30 },
        }
    },
    ["K"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.20, y = 0.00 },
            { x = 0.20, y = 0.40 },
            { x = 0.40, y = 0.40 },
            { x = 0.40, y = 0.20 },
            { x = 0.50, y = 0.20 },
            { x = 0.50, y = 0.10 },
            { x = 0.60, y = 0.10 },
            { x = 0.60, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.20 },
            { x = 0.70, y = 0.20 },
            { x = 0.70, y = 0.30 },
            { x = 0.60, y = 0.30 },
            { x = 0.60, y = 0.70 },
            { x = 0.70, y = 0.70 },
            { x = 0.70, y = 0.80 },
            { x = 0.80, y = 0.80 },
            { x = 0.80, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.90 },
            { x = 0.50, y = 0.90 },
            { x = 0.50, y = 0.80 },
            { x = 0.40, y = 0.80 },
            { x = 0.40, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["L"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["M"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.20, y = 0.00 },
            { x = 0.20, y = 0.70 },
            { x = 0.30, y = 0.70 },
            { x = 0.30, y = 0.00 },
            { x = 0.50, y = 0.00 },
            { x = 0.50, y = 0.70 },
            { x = 0.60, y = 0.70 },
            { x = 0.60, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.50, y = 1.00 },
            { x = 0.50, y = 0.90 },
            { x = 0.30, y = 0.90 },
            { x = 0.30, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
        }
    },
    ["N"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.20, y = 0.00 },
            { x = 0.20, y = 0.70 },
            { x = 0.30, y = 0.70 },
            { x = 0.30, y = 0.30 },
            { x = 0.36, y = 0.30 },
            { x = 0.36, y = 0.20 },
            { x = 0.50, y = 0.20 },
            { x = 0.50, y = 0.10 },
            { x = 0.60, y = 0.10 },
            { x = 0.60, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.30 },
            { x = 0.50, y = 0.30 },
            { x = 0.50, y = 0.70 },
            { x = 0.44, y = 0.70 },
            { x = 0.44, y = 0.80 },
            { x = 0.30, y = 0.80 },
            { x = 0.30, y = 0.90 },
            { x = 0.20, y = 0.90 },
            { x = 0.20, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["O"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
        }
    },
    ["P"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.20, y = 0.00 },
            { x = 0.20, y = 0.40 },
            { x = 0.70, y = 0.40 },
            { x = 0.70, y = 0.50 },
            { x = 0.80, y = 0.50 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["Q"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.40, y = 0.00 },
            { x = 0.40, y = 0.10 },
            { x = 0.60, y = 0.10 },
            { x = 0.60, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.20 },
            { x = 0.70, y = 0.20 },
            { x = 0.70, y = 0.90 },
            { x = 0.60, y = 0.90 },
            { x = 0.60, y = 1.00 },
            { x = 0.50, y = 1.00 },
            { x = 0.50, y = 0.30 },
            { x = 0.40, y = 0.30 },
            { x = 0.40, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.80 },
            { x = 0.50, y = 0.80 },
            { x = 0.50, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
        }
    },
    ["R"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.20, y = 0.00 },
            { x = 0.20, y = 0.40 },
            { x = 0.30, y = 0.40 },
            { x = 0.30, y = 0.30 },
            { x = 0.40, y = 0.30 },
            { x = 0.40, y = 0.10 },
            { x = 0.50, y = 0.10 },
            { x = 0.50, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.10 },
            { x = 0.70, y = 0.10 },
            { x = 0.70, y = 0.20 },
            { x = 0.60, y = 0.20 },
            { x = 0.60, y = 0.40 },
            { x = 0.70, y = 0.40 },
            { x = 0.70, y = 0.50 },
            { x = 0.80, y = 0.50 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["S"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 0.50 },
            { x = 0.70, y = 0.50 },
            { x = 0.70, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.80 },
            { x = 0.60, y = 0.80 },
            { x = 0.60, y = 0.70 },
            { x = 0.80, y = 0.70 },
            { x = 0.80, y = 0.90 },
            { x = 0.70, y = 0.90 },
            { x = 0.70, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
            { x = 0.00, y = 0.50 },
            { x = 0.10, y = 0.50 },
            { x = 0.10, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.30 },
            { x = 0.00, y = 0.30 },
        }
    },
    ["T"] = {
        {
            { x = 0.00, y = 0.80 },
            { x = 0.30, y = 0.80 },
            { x = 0.30, y = 0.00 },
            { x = 0.50, y = 0.00 },
            { x = 0.50, y = 0.80 },
            { x = 0.80, y = 0.80 },
            { x = 0.80, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["U"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["V"] = {
        {
            { x = 0.00, y = 0.40 },
            { x = 0.10, y = 0.40 },
            { x = 0.10, y = 0.20 },
            { x = 0.16, y = 0.20 },
            { x = 0.16, y = 0.10 },
            { x = 0.30, y = 0.10 },
            { x = 0.30, y = 0.00 },
            { x = 0.50, y = 0.00 },
            { x = 0.50, y = 0.10 },
            { x = 0.64, y = 0.10 },
            { x = 0.64, y = 0.20 },
            { x = 0.70, y = 0.20 },
            { x = 0.70, y = 0.40 },
            { x = 0.80, y = 0.40 },
            { x = 0.80, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.40 },
            { x = 0.50, y = 0.40 },
            { x = 0.50, y = 0.20 },
            { x = 0.30, y = 0.20 },
            { x = 0.30, y = 0.40 },
            { x = 0.20, y = 0.40 },
            { x = 0.20, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["W"] = {
        {
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.30, y = 0.00 },
            { x = 0.30, y = 0.10 },
            { x = 0.50, y = 0.10 },
            { x = 0.50, y = 0.00 },
            { x = 0.70, y = 0.00 },
            { x = 0.70, y = 0.10 },
            { x = 0.80, y = 0.10 },
            { x = 0.80, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.30 },
            { x = 0.50, y = 0.30 },
            { x = 0.50, y = 0.80 },
            { x = 0.30, y = 0.80 },
            { x = 0.30, y = 0.30 },
            { x = 0.20, y = 0.30 },
            { x = 0.20, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["X"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.20, y = 0.00 },
            { x = 0.20, y = 0.20 },
            { x = 0.30, y = 0.20 },
            { x = 0.30, y = 0.40 },
            { x = 0.50, y = 0.40 },
            { x = 0.50, y = 0.20 },
            { x = 0.60, y = 0.20 },
            { x = 0.60, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.20 },
            { x = 0.70, y = 0.20 },
            { x = 0.70, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.60 },
            { x = 0.70, y = 0.60 },
            { x = 0.70, y = 0.80 },
            { x = 0.80, y = 0.80 },
            { x = 0.80, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.80 },
            { x = 0.50, y = 0.80 },
            { x = 0.50, y = 0.60 },
            { x = 0.30, y = 0.60 },
            { x = 0.30, y = 0.80 },
            { x = 0.20, y = 0.80 },
            { x = 0.20, y = 1.00 },
            { x = 0.00, y = 1.00 },
            { x = 0.00, y = 0.80 },
            { x = 0.10, y = 0.80 },
            { x = 0.10, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.40 },
            { x = 0.10, y = 0.40 },
            { x = 0.10, y = 0.20 },
            { x = 0.00, y = 0.20 },
        }
    },
    ["Y"] = {
        {
            { x = 0.00, y = 0.80 },
            { x = 0.10, y = 0.80 },
            { x = 0.10, y = 0.60 },
            { x = 0.20, y = 0.60 },
            { x = 0.20, y = 0.40 },
            { x = 0.30, y = 0.40 },
            { x = 0.30, y = 0.00 },
            { x = 0.50, y = 0.00 },
            { x = 0.50, y = 0.40 },
            { x = 0.60, y = 0.40 },
            { x = 0.60, y = 0.60 },
            { x = 0.70, y = 0.60 },
            { x = 0.70, y = 0.80 },
            { x = 0.80, y = 0.80 },
            { x = 0.80, y = 1.00 },
            { x = 0.60, y = 1.00 },
            { x = 0.60, y = 0.80 },
            { x = 0.50, y = 0.80 },
            { x = 0.50, y = 0.60 },
            { x = 0.30, y = 0.60 },
            { x = 0.30, y = 0.80 },
            { x = 0.20, y = 0.80 },
            { x = 0.20, y = 1.00 },
            { x = 0.00, y = 1.00 },
        }
    },
    ["Z"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.20 },
            { x = 0.30, y = 0.20 },
            { x = 0.30, y = 0.30 },
            { x = 0.40, y = 0.30 },
            { x = 0.40, y = 0.40 },
            { x = 0.50, y = 0.40 },
            { x = 0.50, y = 0.50 },
            { x = 0.60, y = 0.50 },
            { x = 0.60, y = 0.60 },
            { x = 0.70, y = 0.60 },
            { x = 0.70, y = 0.70 },
            { x = 0.80, y = 0.70 },
            { x = 0.80, y = 1.00 },
            { x = 0.00, y = 1.00 },
            { x = 0.00, y = 0.80 },
            { x = 0.50, y = 0.80 },
            { x = 0.50, y = 0.70 },
            { x = 0.40, y = 0.70 },
            { x = 0.40, y = 0.60 },
            { x = 0.30, y = 0.60 },
            { x = 0.30, y = 0.50 },
            { x = 0.20, y = 0.50 },
            { x = 0.20, y = 0.40 },
            { x = 0.10, y = 0.40 },
            { x = 0.10, y = 0.30 },
            { x = 0.00, y = 0.30 },
        }
    },
    ["="] = {
        {
            { x = 0.00, y = 0.20 },
            { x = 0.80, y = 0.20 },
            { x = 0.80, y = 0.40 },
            { x = 0.00, y = 0.40 },
        },
        {
            { x = 0.00, y = 0.60 },
            { x = 0.80, y = 0.60 },
            { x = 0.80, y = 0.80 },
            { x = 0.00, y = 0.80 },
        }
    },
    ["*"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.10, y = 0.00 },
            { x = 0.10, y = 0.10 },
            { x = 0.20, y = 0.10 },
            { x = 0.20, y = 0.20 },
            { x = 0.30, y = 0.20 },
            { x = 0.30, y = 0.30 },
            { x = 0.40, y = 0.30 },
            { x = 0.40, y = 0.00 },
            { x = 0.60, y = 0.00 },
            { x = 0.60, y = 0.30 },
            { x = 0.70, y = 0.30 },
            { x = 0.70, y = 0.20 },
            { x = 0.80, y = 0.20 },
            { x = 0.80, y = 0.10 },
            { x = 0.90, y = 0.10 },
            { x = 0.90, y = 0.00 },
            { x = 1.00, y = 0.00 },
            { x = 1.00, y = 0.20 },
            { x = 0.90, y = 0.20 },
            { x = 0.90, y = 0.30 },
            { x = 0.80, y = 0.30 },
            { x = 0.80, y = 0.40 },
            { x = 0.70, y = 0.40 },
            { x = 0.70, y = 0.60 },
            { x = 0.80, y = 0.60 },
            { x = 0.80, y = 0.70 },
            { x = 0.90, y = 0.70 },
            { x = 0.90, y = 0.80 },
            { x = 1.00, y = 0.80 },
            { x = 1.00, y = 1.00 },
            { x = 0.90, y = 1.00 },
            { x = 0.90, y = 0.90 },
            { x = 0.80, y = 0.90 },
            { x = 0.80, y = 0.80 },
            { x = 0.70, y = 0.80 },
            { x = 0.70, y = 0.70 },
            { x = 0.60, y = 0.70 },
            { x = 0.60, y = 1.00 },
            { x = 0.40, y = 1.00 },
            { x = 0.40, y = 0.70 },
            { x = 0.30, y = 0.70 },
            { x = 0.30, y = 0.80 },
            { x = 0.20, y = 0.80 },
            { x = 0.20, y = 0.90 },
            { x = 0.10, y = 0.90 },
            { x = 0.10, y = 1.00 },
            { x = 0.00, y = 1.00 },
            { x = 0.00, y = 0.80 },
            { x = 0.10, y = 0.80 },
            { x = 0.10, y = 0.70 },
            { x = 0.20, y = 0.70 },
            { x = 0.20, y = 0.60 },
            { x = 0.30, y = 0.60 },
            { x = 0.30, y = 0.40 },
            { x = 0.20, y = 0.40 },
            { x = 0.20, y = 0.30 },
            { x = 0.10, y = 0.30 },
            { x = 0.10, y = 0.20 },
            { x = 0.00, y = 0.20 },
        }
    },
    ["#"] = {
        {
            { x = 1.10, y = 0.90 },
            { x = 1.00, y = 0.90 },
            { x = 1.00, y = 1.00 },
            { x = 0.90, y = 1.00 },
            { x = 0.90, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.80 },
            { x = 0.90, y = 0.80 },
            { x = 0.90, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 1.00, y = 0.00 },
            { x = 1.00, y = 0.10 },
            { x = 1.10, y = 0.10 },
            { x = 0.80, y = 0.70 },
            { x = 0.30, y = 0.70 },
            { x = 0.30, y = 0.30 },
            { x = 0.40, y = 0.30 },
            { x = 0.40, y = 0.60 },
            { x = 0.50, y = 0.60 },
            { x = 0.50, y = 0.30 },
            { x = 0.60, y = 0.30 },
            { x = 0.60, y = 0.60 },
            { x = 0.70, y = 0.60 },
            { x = 0.70, y = 0.30 },
            { x = 0.80, y = 0.30 },
        }
    },
    ["-"] = {
        {
            { x = 0.00, y = 0.40 },
            { x = 0.80, y = 0.40 },
            { x = 0.80, y = 0.60 },
            { x = 0.00, y = 0.60 },
        }
    },
    ["@"] = {
        {
            { x = 1.00, y = 0.90 },
            { x = 0.90, y = 0.90 },
            { x = 0.90, y = 1.00 },
            { x = 0.80, y = 1.00 },
            { x = 0.80, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.80 },
            { x = 0.80, y = 0.80 },
            { x = 0.80, y = 1.00 },
            { x = 0.10, y = 1.00 },
            { x = 0.10, y = 0.90 },
            { x = 0.00, y = 0.90 },
            { x = 0.00, y = 0.10 },
            { x = 0.10, y = 0.10 },
            { x = 0.10, y = 0.00 },
            { x = 0.90, y = 0.00 },
            { x = 0.90, y = 0.10 },
            { x = 1.00, y = 0.10 },
            { x = 0.30, y = 0.30 },
            { x = 0.70, y = 0.30 },
            { x = 0.70, y = 0.45 },
            { x = 0.60, y = 0.45 },
            { x = 0.60, y = 0.40 },
            { x = 0.40, y = 0.40 },
            { x = 0.40, y = 0.60 },
            { x = 0.60, y = 0.60 },
            { x = 0.60, y = 0.55 },
            { x = 0.70, y = 0.55 },
            { x = 0.70, y = 0.70 },
            { x = 0.30, y = 0.70 },
        }
    },
    ["_"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.80, y = 0.00 },
            { x = 0.80, y = 0.20 },
            { x = 0.00, y = 0.20 },
        }
    },
    ["."] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.20, y = 0.00 },
            { x = 0.20, y = 0.20 },
            { x = 0.00, y = 0.20 },
        }
    },
    ["/"] = {
        {
            { x = 0.00, y = 0.00 },
            { x = 0.00, y = 0.20 },
            { x = 0.10, y = 0.20 },
            { x = 0.10, y = 0.40 },
            { x = 0.20, y = 0.40 },
            { x = 0.20, y = 0.60 },
            { x = 0.30, y = 0.60 },
            { x = 0.30, y = 0.80 },
            { x = 0.40, y = 0.80 },
            { x = 0.40, y = 1.00 },
            { x = 0.50, y = 1.00 },
            { x = 0.50, y = 0.60 },
            { x = 0.40, y = 0.60 },
            { x = 0.40, y = 0.40 },
            { x = 0.30, y = 0.40 },
            { x = 0.30, y = 0.20 },
            { x = 0.20, y = 0.20 },
            { x = 0.20, y = 0.00 },
        }
    },
}

function parameters()
    pcell.add_parameters(
        { "text(Text)",                  "TEXT" },
        { "scale",                            1 },
        { "lettersize(Letter Size)     ",  1000 },
        { "spacing(Width of a Space)",      600 },
        { "letterspacing(Letter Spacing)",  200 },
        { "leading(Line Leading)",          200 },
        { "alignment(Text Alignment)",   "left" },
        { "metalnum(Metal Number)",          -1 }
    )
end

function layout(text, _P)
    local x = 0
    local y = 0
    for i = 1, #_P.text do
        local char = string.sub(string.upper(_P.text), i, i)
        if char == "\n" then
            x = 0
            y = y - _P.scale * (_P.lettersize - _P.leading)
        else
            if char == " " then
                x = x + _P.scale * _P.spacing
            else
                local outlines = letteroutlines[char]
                if outlines then
                    local width = 0
                    for _, outline in ipairs(outlines) do
                        local pts = {}
                        local minx, maxx = math.huge, -math.huge
                        for _, pt in ipairs(outline) do
                            minx = math.min(_P.scale * _P.lettersize * pt.x, minx)
                            maxx = math.max(_P.scale * _P.lettersize * pt.x, maxx)
                            table.insert(pts, point.create(_P.scale * _P.lettersize * pt.x + x, _P.scale * _P.lettersize * pt.y + y))
                        end
                        geometry.polygon(text, generics.metal(_P.metalnum), pts)
                        width = math.max(width, maxx - minx)
                    end
                    x = x + width + _P.scale * _P.letterspacing
                end
            end
        end
    end
end

