unicode_text/screenshot.lua

34 lines
963 B
Lua
Raw Permalink Normal View History

#!/usr/bin/env lua5.1
-- -*- coding: utf-8 -*-
dofile("init.lua")
dofile("../tga_encoder/init.lua")
font = unicode_text.hexfont(
{
kerning = true,
}
)
font:load_glyphs(
io.lines("unifont.hex")
)
font:load_glyphs(
io.lines("unifont_upper.hex")
)
local text = "\
\
\
\
Heizölrückstoßabdämpfung \
נקודה מודגשת \
Ξεσκεπάζω τν ψυχοφθόρα βδελυγμία \
\
qരഹ്മപുരത്ത \
В чащах юга жил бы цитрус? \
𝐛𝐨𝐥𝐝 𝒊𝒕𝒂𝒍𝒊𝒄 🌍🐍🔍😍 \
"
local pixels = font:render_text(text)
local image = tga_encoder.image(pixels)
image:save("screenshot.tga")