unicode_text/screenshot.lua

34 lines
988 B
Lua
Raw 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")