Add a font property to the item

This commit is contained in:
Emmanuel Lepage Vallee 2018-11-10 21:22:38 -05:00
parent 7d8b5a0542
commit 9f81638643
2 changed files with 6 additions and 0 deletions

View File

@ -235,6 +235,7 @@ Multiple items can have multiple sets of options.
| margins | Read/Write table (left,right,top and bottom) | dynamic table |
| infoshapes | See the infoshapes widget documentation | array of infoshapes|
| overlay_draw | Draw a custom painter on top of the item | draw function |
| font | Set a custom font | font_string |
### Colors options

View File

@ -196,6 +196,11 @@ local function new_item(data,args)
item_style(item)
end
function item:set_font(f)
local text_w = item._internal.text_w
text_w:set_font(f)
end
function item:set_text(text)
local text_w = item._internal.text_w
if not text_w then return end