i know this is almost a year old
you can use u+2800 to u+28ff to do that
every character is 2x4 pixels
add the following amount for each pixel
1 8
2 16
4 32
64 128
some example code:
local unicode = require("unicode")
local PIXEL_AMOUNTS = {
{0x01, 0x08},
{0x02, 0x10},
{0x04, 0x20},
{0x40, 0x80},
}
local function draw(pixels)
if #pixels % 4 ~= 0 then
error("image height must be a multiple of 4")
end
if #pixels[1] % 2 ~= 0 then
error("image width mode be a multiple of 2")
end
for cy = 1, #pixels, 4 do
for cx = 1, #pixels[1], 2 do
local char_code = 0x2800
for y = 1, 4 do
for x = 1, 2 do
if pixels[cy + y - 1][cx + x - 1] then
char_code = char_code + PIXEL_AMOUNTS[y][x]
end
end
end
io.write(unicode.char(char_code))
end
io.write("\n")
end
end
local image = {
{false, true, true, true, true, true, true, false},
{true, false, false, false, false, false, false, true},
{true, false, true, false, false, true, false, true},
{true, false, false, false, false, false, false, true},
{true, false, true, true, true, true, false, true},
{true, false, false, true, true, false, false, true},
{true, false, false, false, false, false, false, true},
{false, true, true, true, true, true, true, false},
}
draw(image)
if you see this image multiple times its bc oc fourms is broken