Canvas.fontstyle
Get or set the current Canvas font style, a table value with the following optional boolean keys :
bold:truefor bold font styleitalic:truefor italic font styleunderline:truefor underlined font stylestrikeout:truefor strikeout font style
Example
--! luart-extensions
import ui
require "canvas"
-- create a fixed Window
local win = ui.Window("Canvas:fontstyle() sample", "fixed", 320, 200)
-- create a Canvas
local canvas = ui.Canvas(win)
-- align the Canvas in all of its parent area
canvas.font = "Times New Roman"
canvas.fontsize = 37.5
canvas.fontstyle = "italic"
-- don't use onPaint() event, draw only once
canvas:print(canvas.font, 16, 70)
await win:showasync()