<Serializable()> Public Class TextObject
    Inherits GraphicBase
    Dim _fontname As String = "Arial"
    Dim _fontpt As Single = 9.0
    Dim _fonttext As String = ""

    Public Property FontName() As String
        Get
            Return _fontname
        End Get
        Set(ByVal Value As String)
            _fontname = Value
        End Set
    End Property

    Public Property FontPt() As Single
        Get
            Return _fontpt
        End Get
        Set(ByVal Value As Single)
            _fontpt = Value
        End Set
    End Property

    Public Property FontText() As String
        Get
            Return _fonttext
        End Get
        Set(ByVal Value As String)
            _fonttext = Value
        End Set
    End Property

    Public Overrides Sub Draw(ByVal g As System.Drawing.Graphics, ByVal isPreview As Boolean)
        ' 描画する
        Dim rc As RectangleF = GetRectangleF()
        If isPreview Then
            ' プレビュー時
            g.DrawRectangle(PreviewPen, rc.X, rc.Y, rc.Width, rc.Height)
        Else
            ' 非プレビュー時
            If Not FillColor.IsEmpty() Then
                Dim b As New SolidBrush(FillColor)
                Dim f As Font
                Try
                    f = New Font(FontName, FontPt, FontStyle.Regular, GraphicsUnit.Point)
                Catch ex As Exception
                    f = New Font(FontFamily.GenericMonospace, _fontpt, FontStyle.Regular, GraphicsUnit.Point)
                End Try
                g.DrawString(FontText, f, b, rc)
            End If
        End If

    End Sub
End Class
