コード例 #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));
        }
コード例 #2
0
ファイル: ContentWriter.cs プロジェクト: deaddog/DeadDog.PDF
 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);
 }
コード例 #3
0
ファイル: ContentWriter.cs プロジェクト: deaddog/DeadDog.PDF
 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));
 }
コード例 #4
0
ファイル: ContentWriter.cs プロジェクト: deaddog/DeadDog.PDF
 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));
 }
コード例 #5
0
ファイル: ContentWriter.cs プロジェクト: deaddog/DeadDog.PDF
 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));
 }
コード例 #6
0
ファイル: ContentWriter.cs プロジェクト: deaddog/DeadDog.PDF
 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));
 }
コード例 #7
0
ファイル: ContentWriter.cs プロジェクト: deaddog/DeadDog.PDF
        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();
        }
コード例 #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);
        }
コード例 #9
0
ファイル: VerticalGroup.cs プロジェクト: deaddog/DeadDog.PDF
 public VerticalGroup(Vector1D spacer, params PDFObject[] objects)
     : base(spacer, objects)
 {
 }
コード例 #10
0
ファイル: Vector2D.cs プロジェクト: deaddog/DeadDog.PDF
 public Vector2D(double x, double y, UnitsOfMeasure unit)
 {
     this.x = new Vector1D(x, unit);
     this.y = new Vector1D(y, unit);
 }
コード例 #11
0
 public HorizontalGroup(Vector1D spacer, params PDFObject[] objects)
     : base(spacer, objects)
 {
 }
コード例 #12
0
ファイル: VerticalGroup.cs プロジェクト: deaddog/DeadDog.PDF
 public VerticalGroup(Vector1D spacer)
     : base(spacer)
 {
 }
コード例 #13
0
 public HorizontalGroup(Vector1D spacer)
     : base(spacer)
 {
 }
コード例 #14
0
ファイル: ContentWriter.cs プロジェクト: deaddog/DeadDog.PDF
 public void Mark(Vector2D v, Vector1D radius)
 {
     Mark(v, radius, Color.Black);
 }
コード例 #15
0
ファイル: StrokeObject.cs プロジェクト: deaddog/DeadDog.PDF
 /// <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);
 }
コード例 #16
0
ファイル: ContentWriter.cs プロジェクト: deaddog/DeadDog.PDF
 public void MoveTo(Vector1D x, Vector1D y)
 {
     cb.MoveTo(
         (float)x.Value(UnitsOfMeasure.Points),
         (float)y.Value(UnitsOfMeasure.Points));
 }
コード例 #17
0
ファイル: Vector2D.cs プロジェクト: deaddog/DeadDog.PDF
 public Vector2D(Vector1D x, Vector1D y)
 {
     this.x = x;
     this.y = y;
 }