예제 #1
0
        internal override void Flatten(GlyphPartFlattener flattener)
        {
#if DEBUG
            flattener.dbugSetCurrentOwnerPart(this);
#endif
            flattener.GeneratePointsFromLine(
                this.FirstPoint,
                new Vector2(x1, y1));
        }
예제 #2
0
        internal override void Flatten(GlyphPartFlattener flattener)
        {
#if DEBUG
            flattener.dbugSetCurrentOwnerPart(this);
#endif
            flattener.GeneratePointsFromCurve3(
                flattener.NSteps,
                this.FirstPoint,      //first
                new Vector2(x2, y2),  //end
                new Vector2(x1, y1)); //control1
        }
예제 #3
0
        internal void Flatten(GlyphPartFlattener flattener)
        {
            //flatten once
            if (_analyzed)
            {
                return;
            }
            //flatten each part ...
            //-------------------------------
            int j = parts.Count;
            //---------------
            List <GlyphPoint> prevResult       = flattener.Result;
            List <GlyphPoint> tmpFlattenPoints = flattenPoints = flattener.Result = new List <GlyphPoint>();

            //start ...
            for (int i = 0; i < j; ++i)
            {
                //flatten each part
                parts[i].Flatten(flattener);
            }

            //check duplicated the first point and last point
            int pointCount = tmpFlattenPoints.Count;

            if (GlyphPoint.SameCoordAs(tmpFlattenPoints[pointCount - 1], tmpFlattenPoints[0]))
            {
                //check if the last point is the same value as the first
                //if yes => remove the last one
                tmpFlattenPoints.RemoveAt(pointCount - 1);
                pointCount--;
            }

            //assign number for all glyph point in this contour
            for (int i = 0; i < pointCount; ++i)
            {
                tmpFlattenPoints[i].SeqNo = i;
            }

            flattener.Result = prevResult;
            _analyzed        = true;
        }
예제 #4
0
 internal abstract void Flatten(GlyphPartFlattener flattener);