レイアウト
画像のようなレイアウトを組んでいるとき、文字列を中央にするための計算式。
- 文字列のy座標
(let ((top-line-y 90) (bottom-line-y 185) (string-height 18)) (+ top-line-y (/ (- bottom-line-y top-line-y string-height) 2))) => 128
- 文字列のx座標
(let ((left-line-x 84) (line-width 228.1) (string-width 91)) (+ left-line-x (/ (- line-width string-width) 2))) => 152.55
- 結果