textBaseline - property of the CanvasCtx object
Description:
Vertical alignment of the text.
Syntax:
String textBaseline
Values:
alphabetic (default) - The lower edge of the text (A, a ..) is touching the imagined line
top - The upper edge of the text (A, B ..) is under the imagined line
hanging - The upper edge of the text (a, c ..) is under the imagined line
middle - The imagined line goes through the center of the text block
ideographic - Ideographic text display.
bottom - The lower edge of the text (g, j, y ...) is touching the imagined line
Note:
Property access
for read and write.
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.textBaseline = "middle";