Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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));
        }