user1054158
user1054158

Reputation:

Positioning a text regarding to its graphical center

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

Answers (1)

Francesco Montesano
Francesco Montesano

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

Related Questions