Any change in the Button.font, Button.fontstyle and Button.fontsize properties results in an automatic resizing of the Button so that the content is displayed correctly
Button.fontsize read/write property
Get or set the Button font size, a number that represent the font size in pixels.
Example
local ui = require "ui"
-- create a simple button
local win = ui.Window("Button.fontsize sample", 640, 200)
local button = ui.Button(win, "", 200, 70)
button.fontsize = 16
function button:onClick()
self.fontsize = math.random(8, 24)
self.text = self.font.." font, "..self.fontsize.."px"
end
button:onClick()
win:show()
-- update the user interface until the user closes the Window
repeat
ui.update()
until not win.visible