HTML and CSS Reference
In-Depth Information
ideographic
The bottom of horizontal writing script glyphs such as Han ideographs, Katakana,
Hiragana, and Hangul.
bottom
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" ;
Inreality,youwillprobablychooseasinglebaselineforyourappandstickwithit,unlessyou
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:
center
center
The dead horizontal center of the text. We can use this alignment to help center our text in
Text Arranger.
start
Text is displayed directly after the text y position.
end
All text is displayed before the text y position.
left
Text is displayed starting with the y position of the text in the leftmost position (just like
start ).
Search WWH ::




Custom Search