Promotic

font - property of the CanvasCtx object

Description:
The property returns or sets the current font properties for text content.
Syntax:
String font
Values:
font-style - Specifies the font style.
normal (default)
italic
oblique
font-variant - Specifies the font subset.
normal (default)
small-caps
font-weight - Specifies whether the font is bold.
normal (default)
bold
bolder
lighter
100
200
300
400
500
600
700
800
900
font-size - (default: 10px) Specifies the font size (in pixels).
font-family - (default: sans-serif) Specifies the font family (sans-serif, arial, verdana). If the font family name contains a space then it is necessary to use apostrophes.
caption - Uses the font settings from Windows OS theme control items (buttons, ...)
icon - Uses the font settings from Windows OS theme icons
menu - Uses the font settings from Windows OS theme drop-down menus
message-box - Uses the font settings from Windows OS theme
small-caption - Uses the font settings from Windows OS theme for selecting small control items
status-bar - Uses the font settings from Windows OS theme for status lines
Note:
Property access for read and write.
 
Syntax: "font-style font-variant font-weight font-size font-family". The preset values in the string can be bypassed from the left. Bypassing inside or from the right side is not possible.

This property is also functional in Web panels.
Example:
The ctx variable represents the drawing canvas (CanvasCtx). The setup is done on the "Draw" tab at the beginning of the script of drawing event onDraw as follows:
 
var ctx = pEvent.GetCtx(1);
JavaScriptSelect and copy to clipboard

ctx.font = "10px sans-serif";   // or
ctx.font = "bold 10px sans-serif";   // or
ctx.font = "italic small-caps bold 12px arial";

History:
Pm8.02.06: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.