SvgText.cs 1.47 KB
Newer Older
1
using System;
davescriven's avatar
davescriven committed
2
using System.Collections.Generic;
3
using System.Linq;
davescriven's avatar
davescriven committed
4
5
6
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
7
using Svg.DataTypes;
davescriven's avatar
davescriven committed
8
9
10
11
12
13

namespace Svg
{
    /// <summary>
    /// The <see cref="SvgText"/> element defines a graphics element consisting of text.
    /// </summary>
14
    [SvgElement("text")]
15
    public class SvgText : SvgTextBase
davescriven's avatar
davescriven committed
16
17
18
19
    {
        /// <summary>
        /// Initializes the <see cref="SvgText"/> class.
        /// </summary>
20
        public SvgText() : base() { }
davescriven's avatar
davescriven committed
21
22
23
24
25

        /// <summary>
        /// Initializes a new instance of the <see cref="SvgText"/> class.
        /// </summary>
        /// <param name="text">The text.</param>
26
27
        public SvgText(string text)
            : this()
davescriven's avatar
davescriven committed
28
29
30
        {
            this.Text = text;
        }
31

32
        public override SvgElement DeepCopy()
samjudson's avatar
samjudson committed
33
        {
34
            return DeepCopy<SvgText>();
samjudson's avatar
samjudson committed
35
        }
36

37
        public override SvgElement DeepCopy<T>()
38
        {
39
40
41
42
43
44
45
46
47
48
49
            var newObj = base.DeepCopy<T>() as SvgText;
            newObj.TextAnchor = this.TextAnchor;
            newObj.WordSpacing = this.WordSpacing;
            newObj.LetterSpacing = this.LetterSpacing;
            newObj.Font = this.Font;
            newObj.FontFamily = this.FontFamily;
            newObj.FontSize = this.FontSize;
            newObj.FontWeight = this.FontWeight;
            newObj.X = this.X;
            newObj.Y = this.Y;
            return newObj;
50
        }
davescriven's avatar
davescriven committed
51
    }
Eric Domke's avatar
Eric Domke committed
52
}