Panel.fontstyle read/write property


Get or set the Panel font style, a table value that contains the following keys/values :

  • "italic" : set to true if the font is in italic.
  • "underline" : set to true if the font is underlined.
  • "strike" : set to true if the font is striked.
  • "thin" : set to true if the font is thin.
  • "bold" : set to true if the font is bold.
  • "heavy" : set to true if the font is heavy.
By changing the font style of the Panel, you also change the font style of any newly created child controls.

Example

local ui = require "ui" -- create a fixed Panel local win = ui.Window("Panel.fontstyle sample", "fixed", 320, 200) -- create a Panel local panel = ui.Panel(win, 0, 0, 100, 100) panel.bgcolor = 0x00a060 panel:center() -- change its font panel.font = "Segoe Print" panel.fontsize = 12 panel.fontstyle = { bold = true } -- add a child Label ui.Label(panel, "Label"):center() ui.run(win):wait()