Computer >> Computer tutorials >  >> Programming >> Javascript

Properties to create text using HTML5 Canvas


textBaseline [ = value ]
This property returns the current baseline alignment settings and can be set, to change the baseline alignment. The possible values are top, hanging, middle, alphabetic, ideographic and bottomThe following are the properties to create text:

Sr.No.
Property and Description
1font [ = value ]

This property returns the current font settings and can be set, to change the font.
2textAlign [ = value ]

This property returns the current text alignment settings and can be set, to change the alignment. The possible values are start, end, left, right, and center.
3textBaseline [ = value ]

This property returns the current baseline alignment settings and can be set, to change the baseline alignment. The possible values are top, hanging, middle, alphabetic, ideographic and bottom
4fillText(text, x, y [, maxWidth ] )

This property fills the given text at the given position indicated by the given coordinates x and y.
5strokeText(text, x, y [, maxWidth ] )

This property strokes the given text at the given position indicated by the given coordinates x and y.