public IGlyphDescription DeepClone() { var clonedInstructions = new byte[Instructions.Length]; Array.Copy(Instructions, clonedInstructions, Instructions.Length); var clonedEndPoints = new int[EndPointsOfContours.Length]; Array.Copy(EndPointsOfContours, clonedEndPoints, EndPointsOfContours.Length); var clonedPoints = new GlyphPoint[Points.Length]; Array.Copy(Points, clonedPoints, Points.Length); return(new Glyph(false, clonedInstructions, clonedEndPoints, clonedPoints, Bounds)); }
private GlyphPoint[] MergePoints(IGlyphDescription glyph) { var newPoints = new GlyphPoint[Points.Length + glyph.Points.Length]; for (int i = 0; i < Points.Length; i++) { newPoints[i] = Points[i]; } for (int i = 0; i < glyph.Points.Length; i++) { newPoints[i + Points.Length] = glyph.Points[i]; } return(newPoints); }
public IGlyphDescription Transform(PdfMatrix3By2 matrix) { var newPoints = new GlyphPoint[Points.Length]; for (var i = Points.Length - 1; i >= 0; i--) { var point = Points[i]; var scaled = matrix.ScaleAndRotate(point.Point); scaled = matrix.Translate(scaled); newPoints[i] = new GlyphPoint(scaled, point.IsOnCurve); } return(new Glyph(IsSimple, Instructions, EndPointsOfContours, newPoints, Bounds)); }