Canvas.fontweight readwrite property


Get or set the current Canvas font size, an integer value between 1 and 999. A smaller value indicates a lighter weight, a larger value indicates a heavier weight.

Example

local ui = require "ui" require "canvas" -- create a fixed Window local win = ui.Window("Canvas:fontweight() 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.fontweight = 900 -- don't use onPaint() event, draw only once canvas:begin() canvas:print(canvas.font, 6, 70) canvas:flip() -- shows the Window win:show() while win.visible do ui.update() end