Ejemplo n.º 1
0
        public static Vector2D CalculateSize(string text, FontInfo font)
        {
            var      arr = text.Split('\n');
            Vector1D w   = arr.Max(x => font.MeasureStringWidth(x));

            return(new Vector2D(w, font.Height * arr.Length));
        }
Ejemplo n.º 2
0
 public void Arc(Vector1D x1, Vector1D y1, Vector1D x2, Vector1D y2, float startAngle, float extentAngle)
 {
     cb.Arc(
         (float)x1.Value(UnitsOfMeasure.Points),
         (float)y1.Value(UnitsOfMeasure.Points),
         (float)x2.Value(UnitsOfMeasure.Points),
         (float)y2.Value(UnitsOfMeasure.Points), startAngle, extentAngle);
 }
Ejemplo n.º 3
0
 public void CurveFromTo(Vector1D x1, Vector1D y1, Vector1D x3, Vector1D y3)
 {
     cb.CurveFromTo(
         (float)x1.Value(UnitsOfMeasure.Points),
         (float)y1.Value(UnitsOfMeasure.Points),
         (float)x3.Value(UnitsOfMeasure.Points),
         (float)y3.Value(UnitsOfMeasure.Points));
 }
Ejemplo n.º 4
0
 public void CurveTo(Vector1D x2, Vector1D y2, Vector1D x3, Vector1D y3)
 {
     cb.CurveTo(
         (float)x2.Value(UnitsOfMeasure.Points),
         (float)y2.Value(UnitsOfMeasure.Points),
         (float)x3.Value(UnitsOfMeasure.Points),
         (float)y3.Value(UnitsOfMeasure.Points));
 }
Ejemplo n.º 5
0
 public void Rectangle(Vector1D x, Vector1D y, Vector1D width, Vector1D height)
 {
     cb.Rectangle(
         (float)x.Value(UnitsOfMeasure.Points),
         (float)y.Value(UnitsOfMeasure.Points),
         (float)width.Value(UnitsOfMeasure.Points),
         (float)height.Value(UnitsOfMeasure.Points));
 }
Ejemplo n.º 6
0
 public void Ellipse(Vector1D x, Vector1D y, Vector1D width, Vector1D height)
 {
     cb.Ellipse(
         (float)x.Value(UnitsOfMeasure.Points),
         (float)y.Value(UnitsOfMeasure.Points),
         (float)(x + width).Value(UnitsOfMeasure.Points),
         (float)(y + height).Value(UnitsOfMeasure.Points));
 }
Ejemplo n.º 7
0
        public void Mark(Vector2D v, Vector1D radius, Color color)
        {
            cb.SetColorStroke(new iTextSharp.text.Color(color));

            MoveTo(v.X - radius, v.Y);
            LineTo(v.X + radius, v.Y);
            cb.Stroke();
            MoveTo(v.X, v.Y - radius);
            LineTo(v.X, v.Y + radius);
            cb.Stroke();
        }
Ejemplo n.º 8
0
        private FontInfo(string name, float size, FontStyle style, iTextSharp.text.Font iFont)
        {
            this.name  = name;
            this.size  = size;
            this.style = style;
            this.iFont = iFont;

            this.ascenderHeight  = GetAscenderHeight(iFont);
            this.descenderHeight = GetDescenderHeight(iFont);
            this.baseHeight      = GetBaseHeight(iFont);
            this.height          = GetLineHeight(iFont);
        }
Ejemplo n.º 9
0
 public VerticalGroup(Vector1D spacer, params PDFObject[] objects)
     : base(spacer, objects)
 {
 }
Ejemplo n.º 10
0
 public Vector2D(double x, double y, UnitsOfMeasure unit)
 {
     this.x = new Vector1D(x, unit);
     this.y = new Vector1D(y, unit);
 }
Ejemplo n.º 11
0
 public HorizontalGroup(Vector1D spacer, params PDFObject[] objects)
     : base(spacer, objects)
 {
 }
Ejemplo n.º 12
0
 public VerticalGroup(Vector1D spacer)
     : base(spacer)
 {
 }
Ejemplo n.º 13
0
 public HorizontalGroup(Vector1D spacer)
     : base(spacer)
 {
 }
Ejemplo n.º 14
0
 public void Mark(Vector2D v, Vector1D radius)
 {
     Mark(v, radius, Color.Black);
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StrokeObject"/> class.
 /// </summary>
 /// <param name="offset">The offset of the <see cref="StrokeObject" />.</param>
 /// <param name="size">The size of the <see cref="StrokeObject" />.</param>
 public StrokeObject(Vector2D offset, Vector2D size)
     : base(offset, size)
 {
     this.border = Color.Black;
     this.width  = new Vector1D(1, UnitsOfMeasure.Points);
 }
Ejemplo n.º 16
0
 public void MoveTo(Vector1D x, Vector1D y)
 {
     cb.MoveTo(
         (float)x.Value(UnitsOfMeasure.Points),
         (float)y.Value(UnitsOfMeasure.Points));
 }
Ejemplo n.º 17
0
 public Vector2D(Vector1D x, Vector1D y)
 {
     this.x = x;
     this.y = y;
 }