The raw idea of a struct is not present in Lua but tables serve a similar purpose.
Using tables:
local font = {
["1"] = {0x2, 0x6, 0x2, 0x2, 0x2},
["2"] = {0xe, 0x1, 0x6, 0x8, 0xf}
}
This can then be accessed font[letter][x] or font.letter[x]. Bear in mind that Lua arrays are not zero-indexed, so x starts at 1.
If you need a bit more structure then you could use a function to construct the table:
local function charmatrix(c, l1, l2, l3, l4, l5)
return {[c] = { l1, l2, l3, l4, l5 }}
end
local font = {
charmatrix("1", 0x2, 0x6, 0x2, 0x2, 0x2),
charmatrix("2", 0xe, 0x1, 0x6, 0x8, 0xf),
}
but that might be overkill.
Edit: If you want to keep the line in the code you could construct a table like so:
local font = {
["1"] = { line = {0x2, 0x6, 0x2, 0x2, 0x2} },
["2"] = { line = {0xe, 0x1, 0x6, 0x8, 0xf} }
}
Accessed font[letter].line[x] or font.letter.line[x].
Note that keys which are strings do not need quotes when being defined, aside from numeric strings which is why line is not surrounded by quotation marks wheras "1" and "2" are. (So you could access with code: font[letter]["line"][x])