This commit is contained in:
Kathy Ruffing 2011-10-14 10:43:47 +00:00
parent 7af8870639
commit c04081d056
5 changed files with 48 additions and 0 deletions

View File

@ -9,6 +9,12 @@ namespace Volian.Svg.Library
[XmlRoot("svg")] [XmlRoot("svg")]
public partial class Svg : SvgGroup public partial class Svg : SvgGroup
{ {
private static System.Drawing.PointF _AbsoluteOffset;
public static System.Drawing.PointF AbsoluteOffset
{
get { return Svg._AbsoluteOffset; }
set { Svg._AbsoluteOffset = value; }
}
private static System.Drawing.Color _OverrrideColor = System.Drawing.Color.Empty; private static System.Drawing.Color _OverrrideColor = System.Drawing.Color.Empty;
public static System.Drawing.Color OverrideColor public static System.Drawing.Color OverrideColor
{ {

View File

@ -86,6 +86,16 @@ namespace Volian.Svg.Library
set { _Y2 = SvgXmlConverter<SvgMeasurement>.GetObject(value); } set { _Y2 = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
} }
#endregion #endregion
#region Description
private string _Description = string.Empty;
[System.ComponentModel.DefaultValueAttribute("")]
[XmlElement("desc")]
public string Description
{
get { return _Description; }
set { _Description = value; }
}
#endregion
#region LineColor #region LineColor
//protected Color _LineColor = Color.Empty; //protected Color _LineColor = Color.Empty;
//[XmlIgnoreAttribute()] //[XmlIgnoreAttribute()]

View File

@ -23,6 +23,16 @@ namespace Volian.Svg.Library
} }
//XMLElementAttribute(ElementName = "PREFIX", IsNullable = false) //XMLElementAttribute(ElementName = "PREFIX", IsNullable = false)
#endregion #endregion
#region Description
private string _Description = string.Empty;
[System.ComponentModel.DefaultValueAttribute("")]
[XmlElement("desc")]
public string Description
{
get { return _Description; }
set { _Description = value; }
}
#endregion
#region Location #region Location
private SvgMeasurement _X = new SvgMeasurement(); private SvgMeasurement _X = new SvgMeasurement();
[XmlIgnore] [XmlIgnore]

View File

@ -79,6 +79,18 @@ namespace Volian.Svg.Library
{ {
return _Scale * (y - YLowerLimit); return _Scale * (y - YLowerLimit);
} }
public float AbsX(SvgMeasurement x)
{
return x.GetSizeInPixels(DPI) + Svg.AbsoluteOffset.X;
}
public float AbsY(iTextSharp.text.pdf.PdfContentByte cb, SvgMeasurement y)
{
// the following line of code is 'taken' from the 16bit code: \promsnt\exe\wined\togdi.cpp
// whenever doing an 'Absolute' macro.
float yOffset = 54 * 4.8f + 0.5f; // yOffset starts in 'twips' (twip = 1/20 point)
yOffset = yOffset / 20; // convert from twips to points (point = 1/72 inch)
return cb.PdfDocument.PageSize.Height - y.GetSizeInPixels(DPI) + yOffset + Svg.AbsoluteOffset.Y;
}
public float Y(iTextSharp.text.pdf.PdfContentByte cb, float y) public float Y(iTextSharp.text.pdf.PdfContentByte cb, float y)
{ {
return cb.PdfDocument.PageSize.Height - _Scale * (y - YLowerLimit); return cb.PdfDocument.PageSize.Height - _Scale * (y - YLowerLimit);

View File

@ -125,6 +125,16 @@ namespace Volian.Svg.Library
set { _MyFontSettings.TextDecoration = value; } set { _MyFontSettings.TextDecoration = value; }
} }
#endregion #endregion
#region Description
private string _Description = string.Empty;
[System.ComponentModel.DefaultValueAttribute("")]
[XmlElement("desc")]
public string Description
{
get { return _Description; }
set { _Description = value; }
}
#endregion
#region Setup Inheritance #region Setup Inheritance
override internal void SetupInheritance(SvgInheritedSettings myParentsSettings) override internal void SetupInheritance(SvgInheritedSettings myParentsSettings)
{ {