View Source Scenic.Primitive.Style.TextBase (Scenic v0.11.2)
Set the vertical alignment of text.
Example:
graph
|> text( "Some Text", text_base: :alphabetic )
data-format
Data Format
TextBase can be any one of the following values
:top
- The top of the em square.:middle
- The middle of the em square.:alphabetic
- The normal alphabetic baseline.:bottom
- The bottom of the bounding box.
The default if :text_base
is undefined is :alphabetic
.
The alphabetic baseline is at the bottom of characters such as "a", but above the
bottom of characters with descending tails, such as "g" or "y". This the standard
baseline from the world of typography. It may be unintuitive if you expected it
to be at the top of the characters, like most of the primitives in Scenic.
If that is what you want, then set :text_base
to :top