Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
最終結果が本当に中心になるように、正方形の中心にテキストを配置したいと思います。
メソッドテキストがあることは知っていますが、グラフィックセンターに関するテキストを配置していないようです。
horizontalalignmentキーワードおよびを使用して、指定された座標に対してテキストの境界ボックスを揃えることができますverticalalignment(ドキュメントを参照Textしてください)。
horizontalalignment
verticalalignment
Text
オプションは次のとおりです。
horizontalalignment = [ 'center' | 'right' | 'left' ] verticalalignment = [ 'center' | 'top' | 'bottom' | 'baseline' ]