I have created a loop in LUA that displays all utf8 characters directly in the Conky window. The last character Conky could display was utf8 11858 (decimal).
The LUA code to display a Unicode directly: utf8.char(dezimal_unicode)
I took screenshots of all screens containing characters that Conky could display and saved them in my drive space.
https://drive.google.com/drive/folders/ ... sp=sharing
a section: test.lua
Code: Select all
--[[
2023 Bleys
]]
require 'cairo'
require "imlib2"
home_path = os.getenv ('HOME')
function rgb_to_rgba(color,alpha)
if color == nil then color=0xFF0000 end
if alpha == nil then alpha=1 end
return ((color / 0x10000) % 0x100) / 255., ((color / 0x100) % 0x100) / 255., (color % 0x100) / 255., alpha
end
function draw_bg(cr,color,alpha,typ) -- zeichne Hintergrund Conky Fenster / draw Conky Area Background
local corner_r=0
local bg_color=color
local bg_alpha=alpha
local w=conky_window.width
local h=conky_window.height
cairo_set_source_rgba(cr,rgb_to_rgba(bg_color,bg_alpha))
cairo_move_to(cr,corner_r,0)
cairo_line_to(cr,w-corner_r,0)
cairo_curve_to(cr,w,0,w,0,w,corner_r)
cairo_line_to(cr,w,h-corner_r)
cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
cairo_line_to(cr,corner_r,h)
cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
cairo_line_to(cr,0,corner_r)
cairo_curve_to(cr,0,0,0,0,corner_r,0)
cairo_close_path(cr)
if typ==1 then
cairo_fill(cr)
else
cairo_set_line_width(cr, 3)
cairo_stroke(cr)
end
end
function write_text(cr, x, y, text, f)
--write_text(cr, x, y, text, {})
--font attributes (Schriftattribute zuweisen oder default Werte annehmen)
local font=f.font or "Noto Sans"
local size=f.size or 10
local align=f.align or 'l'
local bold=f.bold or false
local ital=f.italic or false
local color=f.color or "0xffffff"
local slant=CAIRO_FONT_SLANT_NORMAL
if ital then slant=CAIRO_FONT_SLANT_ITALIC end
local weight=CAIRO_FONT_WEIGHT_NORMAL
if bold then weight=CAIRO_FONT_WEIGHT_BOLD end
--Text Size (Textgröße für die Plazierung bestimmen.)
local x_a=0
local y_a=0
local te = cairo_text_extents_t:create()
tolua.takeownership(te)
cairo_select_font_face (cr, font, slant, weight)
cairo_set_font_size (cr, size)
cairo_text_extents (cr, text, te)
--Text Position
if align=='c' then
x_a = -(te.width/2+te.x_bearing)
y_a = -(te.height/2+te.y_bearing)
end
if align=='r' then
x_a = -(te.width+te.x_bearing)
end
--Schadow 1 Pixel (Schatten für den Text um 1 Pixel versetzt)
cairo_set_source_rgba(cr, rgb_to_rgba(0x000000,1))
cairo_move_to (cr, x+1+x_a, y+1+y_a)
cairo_show_text (cr, text)
cairo_stroke(cr)
-- Now Text on Top (nun den Text oben drauf)
cairo_set_source_rgba(cr, rgb_to_rgba(color,1))
cairo_move_to (cr, x+x_a, y+y_a)
cairo_show_text (cr, text)
cairo_stroke(cr)
end
function conky_main()
if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
local cr=cairo_create(cs)
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>4 then
color=0x5a5a5a alpha=0.9 typ=1
draw_bg(cr,color,alpha,typ) -- Funktion Hintergrund Conky Bereich / Function Backgrounds Conky Area
local z = 10
local x = 20
local y = 20
for yy = 0,960,40 do
for xx = 10,3660,30 do --change 3660 to less then 1920 for FHD Displays!
z=z+1
mychar=utf8.char(z)
write_text(cr, x+xx,y+yy,mychar, {align="l", size=16})
write_text(cr, x+xx,y+yy+20,z, {align="l", size=8})
end
end
end
cairo_surface_destroy(cs)
cairo_destroy(cr)
end
Code: Select all
--[[
unicode Test
]]
conky.config = {
-- — Conky settings
background = false,
update_interval = 1,
total_run_times = 0,
no_buffers = true,
-- — Window specifications with Shadow
own_window = true,
own_window_transparent = true,
own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
-- end
double_buffer = true,
minimum_width = 3720, minimum_height = 1000, --change 3720 to less then 1920 for FHD Displays
alignment = 'top_middle',
gap_x = 10,
gap_y = 10,
-- Lua Load
lua_load = './test.lua',
lua_draw_hook_post = 'main',
};
conky.text = [[
]];