HTML and CSS Reference
In-Depth Information
The bottom of horizontal writing script glyphs such as Han ideographs, Katakana,
Hiragana, and Hangul.
Thebottomofthe em square ofthefontglyphs.Choosingthisbaseline will pushthefont
the farthest up (lowest y position) the canvas.
So,forexample, ifyouwanttoplace yourtextwitha top baseline, youwouldusethefollow-
ing code:
context . textBaseline = "top" ;
All text displayed on the canvas afterward would have this baseline. To change the baseline,
you would change the property:
context . textBaseline = "middle" ;
are creating a word-processing or design application that requires more precise text handling.
Horizontal alignment
The context.textAlign propertyrepresents thehorizontal alignment ofthetext basedonits
x position. These are the available textAlign values:
The dead horizontal center of the text. We can use this alignment to help center our text in
Text Arranger.
Text is displayed directly after the text y position.
All text is displayed before the text y position.
Text is displayed starting with the y position of the text in the leftmost position (just like
start ).
Search WWH ::

Custom Search