Search code examples
luacairoconky

\t in conky shows another character


When I use \t in conky, another character appears on the screen.

enter image description here

Here's what I've used:

 text = 'Uploaded: ' .. conky_parse('${totalup wlp2s0}') .. '\tSpeed: ' .. conky_parse('${upspeed wlp2s0}')

And I used cairo_show_text() function to show the text on the screen.

How can I fix it?


Solution

  • As cairographics says,

    The functions with text in their name form cairo's toy text API

    and its limited functionality is for testing and demos. You will have to do your own work to implement a tab stop by drawing the text, not including the tab character, then reposition the current point to the fixed position you want as tab stop, and draw the rest of the text.