Panel.fontstyle readwrite


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

--! luart-extensions import 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() await win:showasync()