SvgText.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Drawing;
  6. using System.Drawing.Drawing2D;
  7. using Svg.DataTypes;
  8. #pragma warning disable
  9. namespace Svg
  10. {
  11. /// <summary>
  12. /// The <see cref="SvgText"/> element defines a graphics element consisting of text.
  13. /// </summary>
  14. [SvgElement("text")]
  15. public class SvgText : SvgTextBase
  16. {
  17. /// <summary>
  18. /// Initializes the <see cref="SvgText"/> class.
  19. /// </summary>
  20. public SvgText() : base() { }
  21. /// <summary>
  22. /// Initializes a new instance of the <see cref="SvgText"/> class.
  23. /// </summary>
  24. /// <param name="text">The text.</param>
  25. public SvgText(string text)
  26. : this()
  27. {
  28. this.Text = text;
  29. }
  30. public override SvgElement DeepCopy()
  31. {
  32. return DeepCopy<SvgText>();
  33. }
  34. public override SvgElement DeepCopy<T>()
  35. {
  36. var newObj = base.DeepCopy<T>() as SvgText;
  37. newObj.TextAnchor = this.TextAnchor;
  38. newObj.WordSpacing = this.WordSpacing;
  39. newObj.LetterSpacing = this.LetterSpacing;
  40. newObj.Font = this.Font;
  41. newObj.FontFamily = this.FontFamily;
  42. newObj.FontSize = this.FontSize;
  43. newObj.FontWeight = this.FontWeight;
  44. newObj.X = this.X;
  45. newObj.Y = this.Y;
  46. return newObj;
  47. }
  48. }
  49. }
  50. #pragma warning restore