Reputation:
I would like to place a text in the center of square in such a way that the final result is really at the center.
I know that there is the method text but it does not seem to place the text regarding its graphical center.
Upvotes: 1
Views: 66
Reputation: 8658
You can align the bounding box of a text with respect to the given coordinates with the keywors horizontalalignment
and verticalalignment
(see Text
documentations).
The options are:
horizontalalignment = [ 'center' | 'right' | 'left' ]
verticalalignment = [ 'center' | 'top' | 'bottom' | 'baseline' ]
Upvotes: 2