Canvas.font readwrite property


Get or set the current Canvas font, a string representing a font family name, from the Windows system fonts.

Example

local ui = require "ui" require "canvas" -- create a fixed Window local win = ui.Window("Canvas:align() 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 = 40 -- 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