Examples 文字関連 text-anchor-middle.pxdx

文字をセンタリング
<?xml version="1.0" encoding="utf-8"?>
<!-- 用紙サイズ「A4」用紙方向「縦」 -->
<pxd paper-type="a4" orientation="portrait" title="文字">
<page>
   <!-- 値10の時1mmになるように設定 -->
   <svg x="0" y="0" width="21cm" height="29.7cm" viewBox="0 0 2100 2970">
      
      <!-- 横「8cm」縦「5cm」を中心にして文字を書く -->
      <text x="800" y="500" font-size="200" fill="black" stroke="none" text-anchor="middle">文字の例</text>
      
      <!-- 横2cm 縦5cm の位置から横15cm 縦5cmの位置に黒色の線を引く。 -->
      <line x1="200" y1="500" x2="1500" y2="500" stroke="black" stroke-width="1"/>
      
      <!-- 横8cm 縦2cm の位置から横8cm 縦5cmの位置に黒色の線を引く。 -->
      <line x1="800" y1="200" x2="800" y2="500" stroke="black" stroke-width="1"/>
   </svg>
</page>
</pxd>