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
26
27
28
29

        /// <summary>
        /// Initializes a new instance of the <see cref="SvgText"/> class.
        /// </summary>
        /// <param name="text">The text.</param>
        public SvgText(string text) : this()
        {
            this.Text = text;
        }
30
31
        
        public override SvgElement DeepCopy()
samjudson's avatar
samjudson committed
32
        {
33
            return DeepCopy<SvgText>();
samjudson's avatar
samjudson committed
34
        }
35

36
        public override SvgElement DeepCopy<T>()
37
        {
38
39
40
41
42
43
44
45
46
47
48
            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;
49
        }
davescriven's avatar
davescriven committed
50
    }
Eric Domke's avatar
Eric Domke committed
51
}