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)); }
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); }
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)); }
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)); }
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)); }
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)); }
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(); }
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); }
public VerticalGroup(Vector1D spacer, params PDFObject[] objects) : base(spacer, objects) { }
public Vector2D(double x, double y, UnitsOfMeasure unit) { this.x = new Vector1D(x, unit); this.y = new Vector1D(y, unit); }
public HorizontalGroup(Vector1D spacer, params PDFObject[] objects) : base(spacer, objects) { }
public VerticalGroup(Vector1D spacer) : base(spacer) { }
public HorizontalGroup(Vector1D spacer) : base(spacer) { }
public void Mark(Vector2D v, Vector1D radius) { Mark(v, radius, Color.Black); }
/// <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); }
public void MoveTo(Vector1D x, Vector1D y) { cb.MoveTo( (float)x.Value(UnitsOfMeasure.Points), (float)y.Value(UnitsOfMeasure.Points)); }
public Vector2D(Vector1D x, Vector1D y) { this.x = x; this.y = y; }