エリアテキストのボックスサイズを指定

エリアテキスト作成時、ボックスがやたらデカイ。
何なんだこれは?


ちょっと調べてみると、どうやらテキストボックスの幅は
特に指定しなければ、フォントサイズに関係なく「文字数 * 6 pt」 のようだ。たぶん。


ちゅう事で、文字列がほどほどに収まるようにボックスの大きさを指定する。
フォントが「ArialMT」、フォントサイズが「6 pt」の場合、
係数は「2.8 pt」くらいが良い感じになった。


ボックスの大きさだけ指定すると、テキストの水平比率が勝手に変化しちゃったので、
そいつも100%に指定する。

        Dim Name As String = "norami"

        'テキストを追加
        nekoName = IllustratorDocument.TextArtItems.Add

        'テキストの文字数で横幅を指定
        Dim temWidth As Single = Name.Length * 2.8

        With nekoName
            .Contents = Name
            .Kind = AiTextType.aiAreaText
            .TextRange.Font = "ArialMT"
            .TextRange.Size = 6
            .TextRange.Paragraphs(1).Justification = AiJustification.aiCenter
            .Top = 3
            .Width = temWidth 'テキストボックスの幅を指定
            .Left = (.Width / 2)

            '水平比率と垂直比率を指定
            Dim sObj(1) As Object
            sObj = New Object() {100, 100}
            .TextRange.Scaling = sObj

        End With