Esempio n. 1
0
        private ShapeDef ReadShapeDef(SWFDataTypeReader shapeReader, Tag format, bool withStyle, IFillStyle[] fillStyles, ILineStyle[] lineStyles)
        {
            ShapeDef shapeDef = new ShapeDef();

            /* Shapes either don't have fill styles (Font glyphs), they come with a bunch of fill styles
             * (Regular shapes) or are preceeded by fill styles which are passed into this method
             * (Morph shapes). Could probably be tidier... */

            if (fillStyles != null)
            {
                shapeDef.FillStyles.AddRange(fillStyles);
            }

            if (lineStyles != null)
            {
                shapeDef.LineStyles.AddRange(lineStyles);
            }

            if (withStyle)
            {
                shapeDef.FillStyles.AddRange(this.ReadFillStyleArray(shapeReader, format));
                shapeReader.Align8();
                shapeDef.LineStyles.AddRange(this.ReadLineStyleArray(shapeReader, format));
                shapeReader.Align8();
            }

            /* Read the shape stuff... */

            int fillBits = (int)shapeReader.ReadUBits(4);
            int lineBits = (int)shapeReader.ReadUBits(4);

            this.ReadShapeRecordsInto(shapeDef, shapeReader, ref fillBits, ref lineBits, format);

            return(shapeDef);
        }
Esempio n. 2
0
        private MorphLineStyle ReadMorphLineStyle2(SWFDataTypeReader shapeReader)
        {
            int startwidth = shapeReader.ReadUI16();
            int endwidth   = shapeReader.ReadUI16();

            CapStyle  startCap = (CapStyle)shapeReader.ReadUBits(2);
            JoinStyle join     = (JoinStyle)shapeReader.ReadUBits(2);

            bool hasFill       = shapeReader.ReadBit();
            bool noHScaling    = shapeReader.ReadBit();
            bool noVScaling    = shapeReader.ReadBit();
            bool hasPixelHints = shapeReader.ReadBit();

            shapeReader.ReadUBits(5); // Reserved: 0
            bool noClose = shapeReader.ReadBit();

            CapStyle endCap = (CapStyle)shapeReader.ReadUBits(2);

            int?miterLimit = null;

            if (join == JoinStyle.Miter)
            {
                miterLimit = shapeReader.ReadUI16();
            }

            Color?         startColour = null;
            Color?         endColour   = null;
            MorphFillStyle fs          = null;

            if (hasFill)
            {
                fs = this.ReadMorphFillStyle(shapeReader);
            }
            else
            {
                startColour = shapeReader.ReadRGBA();
                endColour   = shapeReader.ReadRGBA();
            }

            return(new MorphLineStyle()
            {
                StartWidth = startwidth,
                EndWidth = endwidth,
                StartColour = startColour,
                EndColour = endColour,
                StartCap = startCap,
                EndCap = endCap,
                Join = join,
                HasFill = hasFill,
                NoHScaling = noHScaling,
                NoVScaling = noVScaling,
                HasPixelHints = hasPixelHints,
                FillStyle = fs,
                MiterLimit = miterLimit
            });
        }
Esempio n. 3
0
        private LineStyle ReadLineStyle2(SWFDataTypeReader shapeReader, Tag format)
        {
            int       width         = shapeReader.ReadUI16();
            CapStyle  startCap      = (CapStyle)shapeReader.ReadUBits(2);
            JoinStyle join          = (JoinStyle)shapeReader.ReadUBits(2);
            bool      hasFill       = shapeReader.ReadBit();
            bool      noHScaling    = shapeReader.ReadBit();
            bool      noVScaling    = shapeReader.ReadBit();
            bool      hasPixelHints = shapeReader.ReadBit();

            shapeReader.ReadUBits(5); /* Reserved: 0 */
            bool     noClose = shapeReader.ReadBit();
            CapStyle endCap  = (CapStyle)shapeReader.ReadUBits(2);

            int?miterLimit = null;

            if (join == JoinStyle.Miter)
            {
                miterLimit = shapeReader.ReadUI16();
            }

            Color?    c  = null;
            FillStyle fs = null;

            if (hasFill)
            {
                fs = this.ReadFillStyle(shapeReader, format);
            }
            else
            {
                c = shapeReader.ReadRGBA();
            }

            return(new LineStyle()
            {
                Width = width,
                StartCap = startCap,
                EndCap = endCap,
                Join = join,
                HasFill = hasFill,
                NoHScaling = noHScaling,
                NoVScaling = noVScaling,
                HasPixelHints = hasPixelHints,
                Colour = c,
                FillStyle = fs,
                MiterLimit = miterLimit
            });
        }
Esempio n. 4
0
        private IShape ParseDefineShape4(SWFDataTypeReader shapeReader)
        {
            Rect bounds = shapeReader.ReadRect();

            shapeReader.Align8();
            Rect edgeBounds = shapeReader.ReadRect();

            shapeReader.Align8();

            shapeReader.ReadUBits(5); /* Reserved: 0 */

            bool usesFillWinding       = shapeReader.ReadBit();
            bool usesNonScalingStrokes = shapeReader.ReadBit();
            bool usesScalingStrokes    = shapeReader.ReadBit();

            ShapeDef sws = this.ReadShapeDef(shapeReader, Tag.DefineShape4, true, null, null);

            return(new Shape()
            {
                ShapeDef = sws,
                Bounds = bounds,
                UsesScalingStrokes = usesScalingStrokes,
                UsesNonScalingStrokes = usesNonScalingStrokes,
                UsesFillWinding = usesFillWinding
            });
        }
Esempio n. 5
0
        private Gradient ReadGradient(SWFDataTypeReader shapeReader, Tag format)
        {
            GradientSpread        spread = (GradientSpread)shapeReader.ReadUBits(2);
            GradientInterpolation interp = (GradientInterpolation)shapeReader.ReadUBits(2);

            int numRecs = (int)shapeReader.ReadUBits(4);

            GradientRecord[] recs = new GradientRecord[numRecs];

            for (int i = 0; i < recs.Length; i++)
            {
                GradientRecord rec = new GradientRecord();
                rec.Ratio = shapeReader.ReadUI8();
                if (format == Tag.DefineShape || format == Tag.DefineShape2)
                {
                    rec.Colour = shapeReader.ReadRGB();
                }
                else if (format == Tag.DefineShape3 || format == Tag.DefineShape4)
                {
                    rec.Colour = shapeReader.ReadRGBA();
                }
                else
                {
                    throw new SWFModellerException(SWFModellerError.Internal, "Can't read gradient in shape format " + format.ToString());
                }

                recs[i] = rec;
            }

            return(new Gradient()
            {
                Records = recs,
                Interpolation = interp,
                Spread = spread
            });
        }
Esempio n. 6
0
        private IShape ParseDefineMorphShape(SWFDataTypeReader shapeReader, Tag format)
        {
            Rect startBounds = shapeReader.ReadRect();

            shapeReader.Align8();
            Rect endBounds = shapeReader.ReadRect();

            shapeReader.Align8();

            Rect startEdgeBounds       = null;
            Rect endEdgeBounds         = null;
            bool usesNonScalingStrokes = false;
            bool usesScalingStrokes    = false;

            if (format == Tag.DefineMorphShape2)
            {
                startEdgeBounds = shapeReader.ReadRect();
                shapeReader.Align8();
                endEdgeBounds = shapeReader.ReadRect();
                shapeReader.Align8();

                /*(void)*/ shapeReader.ReadUBits(6); /* Reserved. Assume 0 */

                usesNonScalingStrokes = shapeReader.ReadBit();
                usesScalingStrokes    = shapeReader.ReadBit();
            }

            /*(void)*/ shapeReader.ReadUI32(); /* end edges offset. We don't need this */

            MorphFillStyle[] mfsa = this.ReadMorphFillStyleArray(shapeReader);

            MorphLineStyle[] mlsa = this.ReadMorphLineStyleArray(shapeReader, format);

            ShapeDef startShape = this.ReadShapeDef(shapeReader, format, false, mfsa, mlsa);
            ShapeDef endShape   = this.ReadShapeDef(shapeReader, format, false, mfsa, mlsa);

            return(new MorphShape()
            {
                Bounds = startBounds,
                EndBounds = endBounds,
                StartEdgeBounds = startEdgeBounds,
                EndEdgeBounds = endEdgeBounds,
                UsesNonScalingStrokes = usesNonScalingStrokes,
                UsesScalingStrokes = usesScalingStrokes,
                StartShape = startShape,
                EndShape = endShape
            });
        }
Esempio n. 7
0
        private void ReadShapeRecordsInto(ShapeDef sws, SWFDataTypeReader shapeReader, ref int fillBits, ref int lineBits, Tag format)
        {
            List <IShapeRecord> records = new List <IShapeRecord>();

            int currentX = 0;
            int currentY = 0;

            while (true)
            {
                bool isEdgeRecord = shapeReader.ReadBit();
                if (isEdgeRecord)
                {
                    if (shapeReader.ReadBit())
                    {
                        /* StraightEdgeRecord */
                        int bpv = 2 + (int)shapeReader.ReadUBits(4);

                        bool isGeneralLine = shapeReader.ReadBit();
                        bool isVertical    = false;
                        if (!isGeneralLine)
                        {
                            isVertical = shapeReader.ReadBit();
                        }

                        int dx = 0;
                        int dy = 0;

                        if (isGeneralLine || !isVertical)
                        {
                            dx = shapeReader.ReadSBits(bpv);
                        }

                        if (isGeneralLine || isVertical)
                        {
                            dy = shapeReader.ReadSBits(bpv);
                        }

                        currentX += dx;
                        currentY += dx;

                        records.Add(new StraightEdge()
                        {
                            DX = dx, DY = dy
                        });
                    }
                    else
                    {
                        /* CurvedEdgeRecord */
                        int bpv = 2 + (int)shapeReader.ReadUBits(4);

                        int ctrlDX   = shapeReader.ReadSBits(bpv);
                        int ctrlDY   = shapeReader.ReadSBits(bpv);
                        int anchorDX = shapeReader.ReadSBits(bpv);
                        int anchorDY = shapeReader.ReadSBits(bpv);

                        currentX += ctrlDX + anchorDX;
                        currentY += ctrlDY + anchorDY;

                        records.Add(new CurvedEdge()
                        {
                            AnchorDX = anchorDX, AnchorDY = anchorDY, CtrlDX = ctrlDX, CtrlDY = ctrlDY
                        });
                    }
                }
                else
                {
                    uint flags = shapeReader.ReadUBits(5);

                    if (flags == 0)
                    {
                        /* EndShapeRecord */
                        break;
                    }

                    /* StyleChangeRecord */

                    bool stateMoveTo = (flags & 1) == 1;
                    flags >>= 1;
                    bool stateFillStyle0 = (flags & 1) == 1;
                    flags >>= 1;
                    bool stateFillStyle1 = (flags & 1) == 1;
                    flags >>= 1;
                    bool stateLineStyle = (flags & 1) == 1;
                    flags >>= 1;
                    bool stateNewStyles = (flags & 1) == 1;
                    flags >>= 1;

                    StyleChange sc = new StyleChange();

                    if (stateMoveTo)
                    {
                        int moveBits = (int)shapeReader.ReadUBits(5);

                        sc.DX = shapeReader.ReadSBits(moveBits);
                        sc.DY = shapeReader.ReadSBits(moveBits);

                        currentX = sc.DX.Value;
                        currentY = sc.DY.Value;
                    }

                    if (stateFillStyle0)
                    {
                        sc.FillStyle0 = sws.FillFromIndex((int)shapeReader.ReadUBits(fillBits));
                    }

                    if (stateFillStyle1)
                    {
                        sc.FillStyle1 = sws.FillFromIndex((int)shapeReader.ReadUBits(fillBits));
                    }

                    if (stateLineStyle)
                    {
                        sc.LineStyle = (int)shapeReader.ReadUBits(lineBits);
                    }

                    if (stateNewStyles)
                    {
                        sc.NewFillStyles = this.ReadFillStyleArray(shapeReader, format);
                        sc.NewLineStyles = this.ReadLineStyleArray(shapeReader, format);

                        fillBits = (int)shapeReader.ReadUBits(4);
                        lineBits = (int)shapeReader.ReadUBits(4);

                        /* ISSUE 21: We're storing new styles defined in shape records in two places and
                         * in such a way that we can't figure out where we got them from. This makes
                         * it impossible to reconstruct the SWF data. Kinda need to work out how to
                         * find styles. */

                        sws.FillStyles.AddRange(sc.NewFillStyles);
                        sws.LineStyles.AddRange(sc.NewLineStyles);
                    }

                    records.Add(sc);
                }
            }

            shapeReader.Align8();

            sws.Records = records.ToArray();
        }
Esempio n. 8
0
        private void ReadShapeRecordsInto(ShapeDef sws, SWFDataTypeReader shapeReader, ref int fillBits, ref int lineBits, Tag format)
        {
            List<IShapeRecord> records = new List<IShapeRecord>();

            int currentX = 0;
            int currentY = 0;

            while (true)
            {
                bool isEdgeRecord = shapeReader.ReadBit();
                if (isEdgeRecord)
                {
                    if (shapeReader.ReadBit())
                    {
                        /* StraightEdgeRecord */
                        int bpv = 2 + (int)shapeReader.ReadUBits(4);

                        bool isGeneralLine = shapeReader.ReadBit();
                        bool isVertical = false;
                        if (!isGeneralLine)
                        {
                            isVertical = shapeReader.ReadBit();
                        }

                        int dx = 0;
                        int dy = 0;

                        if (isGeneralLine || !isVertical)
                        {
                            dx = shapeReader.ReadSBits(bpv);
                        }

                        if (isGeneralLine || isVertical)
                        {
                            dy = shapeReader.ReadSBits(bpv);
                        }

                        currentX += dx;
                        currentY += dx;

                        records.Add(new StraightEdge() { DX = dx, DY = dy });
                    }
                    else
                    {
                        /* CurvedEdgeRecord */
                        int bpv = 2 + (int)shapeReader.ReadUBits(4);

                        int ctrlDX = shapeReader.ReadSBits(bpv);
                        int ctrlDY = shapeReader.ReadSBits(bpv);
                        int anchorDX = shapeReader.ReadSBits(bpv);
                        int anchorDY = shapeReader.ReadSBits(bpv);

                        currentX += ctrlDX + anchorDX;
                        currentY += ctrlDY + anchorDY;

                        records.Add(new CurvedEdge() { AnchorDX = anchorDX, AnchorDY = anchorDY, CtrlDX = ctrlDX, CtrlDY = ctrlDY });
                    }
                }
                else
                {
                    uint flags = shapeReader.ReadUBits(5);

                    if (flags == 0)
                    {
                        /* EndShapeRecord */
                        break;
                    }

                    /* StyleChangeRecord */

                    bool stateMoveTo = (flags & 1) == 1;
                    flags >>= 1;
                    bool stateFillStyle0 = (flags & 1) == 1;
                    flags >>= 1;
                    bool stateFillStyle1 = (flags & 1) == 1;
                    flags >>= 1;
                    bool stateLineStyle = (flags & 1) == 1;
                    flags >>= 1;
                    bool stateNewStyles = (flags & 1) == 1;
                    flags >>= 1;

                    StyleChange sc = new StyleChange();

                    if (stateMoveTo)
                    {
                        int moveBits = (int)shapeReader.ReadUBits(5);

                        sc.DX = shapeReader.ReadSBits(moveBits);
                        sc.DY = shapeReader.ReadSBits(moveBits);

                        currentX = sc.DX.Value;
                        currentY = sc.DY.Value;
                    }

                    if (stateFillStyle0)
                    {
                        sc.FillStyle0 = sws.FillFromIndex((int)shapeReader.ReadUBits(fillBits));
                    }

                    if (stateFillStyle1)
                    {
                        sc.FillStyle1 = sws.FillFromIndex((int)shapeReader.ReadUBits(fillBits));
                    }

                    if (stateLineStyle)
                    {
                        sc.LineStyle = (int)shapeReader.ReadUBits(lineBits);
                    }

                    if (stateNewStyles)
                    {
                        sc.NewFillStyles = this.ReadFillStyleArray(shapeReader, format);
                        sc.NewLineStyles = this.ReadLineStyleArray(shapeReader, format);

                        fillBits = (int)shapeReader.ReadUBits(4);
                        lineBits = (int)shapeReader.ReadUBits(4);

                        /* ISSUE 21: We're storing new styles defined in shape records in two places and
                         * in such a way that we can't figure out where we got them from. This makes
                         * it impossible to reconstruct the SWF data. Kinda need to work out how to
                         * find styles. */

                        sws.FillStyles.AddRange(sc.NewFillStyles);
                        sws.LineStyles.AddRange(sc.NewLineStyles);
                    }

                    records.Add(sc);
                }
            }

            shapeReader.Align8();

            sws.Records = records.ToArray();
        }
Esempio n. 9
0
        private IShape ParseDefineMorphShape(SWFDataTypeReader shapeReader, Tag format)
        {
            Rect startBounds = shapeReader.ReadRect();
            shapeReader.Align8();
            Rect endBounds = shapeReader.ReadRect();
            shapeReader.Align8();

            Rect startEdgeBounds = null;
            Rect endEdgeBounds = null;
            bool usesNonScalingStrokes = false;
            bool usesScalingStrokes = false;

            if (format == Tag.DefineMorphShape2)
            {
                startEdgeBounds = shapeReader.ReadRect();
                shapeReader.Align8();
                endEdgeBounds = shapeReader.ReadRect();
                shapeReader.Align8();

                /*(void)*/shapeReader.ReadUBits(6); /* Reserved. Assume 0 */

                usesNonScalingStrokes = shapeReader.ReadBit();
                usesScalingStrokes = shapeReader.ReadBit();
            }

            /*(void)*/shapeReader.ReadUI32(); /* end edges offset. We don't need this */

            MorphFillStyle[] mfsa = this.ReadMorphFillStyleArray(shapeReader);

            MorphLineStyle[] mlsa = this.ReadMorphLineStyleArray(shapeReader, format);

            ShapeDef startShape = this.ReadShapeDef(shapeReader, format, false, mfsa, mlsa);
            ShapeDef endShape = this.ReadShapeDef(shapeReader, format, false, mfsa, mlsa);

            return new MorphShape()
            {
                Bounds = startBounds,
                EndBounds = endBounds,
                StartEdgeBounds = startEdgeBounds,
                EndEdgeBounds = endEdgeBounds,
                UsesNonScalingStrokes = usesNonScalingStrokes,
                UsesScalingStrokes = usesScalingStrokes,
                StartShape = startShape,
                EndShape = endShape
            };
        }
Esempio n. 10
0
        private ShapeDef ReadShapeDef(SWFDataTypeReader shapeReader, Tag format, bool withStyle, IFillStyle[] fillStyles, ILineStyle[] lineStyles)
        {
            ShapeDef shapeDef = new ShapeDef();

            /* Shapes either don't have fill styles (Font glyphs), they come with a bunch of fill styles
             * (Regular shapes) or are preceeded by fill styles which are passed into this method
             * (Morph shapes). Could probably be tidier... */

            if (fillStyles != null)
            {
                shapeDef.FillStyles.AddRange(fillStyles);
            }

            if (lineStyles != null)
            {
                shapeDef.LineStyles.AddRange(lineStyles);
            }

            if (withStyle)
            {
                shapeDef.FillStyles.AddRange(this.ReadFillStyleArray(shapeReader, format));
                shapeReader.Align8();
                shapeDef.LineStyles.AddRange(this.ReadLineStyleArray(shapeReader, format));
                shapeReader.Align8();
            }

            /* Read the shape stuff... */

            int fillBits = (int)shapeReader.ReadUBits(4);
            int lineBits = (int)shapeReader.ReadUBits(4);

            this.ReadShapeRecordsInto(shapeDef, shapeReader, ref fillBits, ref lineBits, format);

            return shapeDef;
        }
Esempio n. 11
0
        private MorphLineStyle ReadMorphLineStyle2(SWFDataTypeReader shapeReader)
        {
            int startwidth = shapeReader.ReadUI16();
            int endwidth = shapeReader.ReadUI16();

            CapStyle startCap = (CapStyle)shapeReader.ReadUBits(2);
            JoinStyle join = (JoinStyle)shapeReader.ReadUBits(2);

            bool hasFill = shapeReader.ReadBit();
            bool noHScaling = shapeReader.ReadBit();
            bool noVScaling = shapeReader.ReadBit();
            bool hasPixelHints = shapeReader.ReadBit();
            shapeReader.ReadUBits(5); // Reserved: 0
            bool noClose = shapeReader.ReadBit();

            CapStyle endCap = (CapStyle)shapeReader.ReadUBits(2);

            int? miterLimit = null;
            if (join == JoinStyle.Miter)
            {
                miterLimit = shapeReader.ReadUI16();
            }

            Color? startColour = null;
            Color? endColour = null;
            MorphFillStyle fs = null;

            if (hasFill)
            {
                fs = this.ReadMorphFillStyle(shapeReader);
            }
            else
            {
                startColour = shapeReader.ReadRGBA();
                endColour = shapeReader.ReadRGBA();
            }

            return new MorphLineStyle()
            {
                StartWidth = startwidth,
                EndWidth = endwidth,
                StartColour = startColour,
                EndColour = endColour,
                StartCap = startCap,
                EndCap = endCap,
                Join = join,
                HasFill = hasFill,
                NoHScaling = noHScaling,
                NoVScaling = noVScaling,
                HasPixelHints = hasPixelHints,
                FillStyle = fs,
                MiterLimit = miterLimit
            };
        }
Esempio n. 12
0
        private LineStyle ReadLineStyle2(SWFDataTypeReader shapeReader, Tag format)
        {
            int width = shapeReader.ReadUI16();
            CapStyle startCap = (CapStyle)shapeReader.ReadUBits(2);
            JoinStyle join = (JoinStyle)shapeReader.ReadUBits(2);
            bool hasFill = shapeReader.ReadBit();
            bool noHScaling = shapeReader.ReadBit();
            bool noVScaling = shapeReader.ReadBit();
            bool hasPixelHints = shapeReader.ReadBit();
            shapeReader.ReadUBits(5); /* Reserved: 0 */
            bool noClose = shapeReader.ReadBit();
            CapStyle endCap = (CapStyle)shapeReader.ReadUBits(2);

            int? miterLimit = null;
            if (join == JoinStyle.Miter)
            {
                miterLimit = shapeReader.ReadUI16();
            }

            Color? c = null;
            FillStyle fs = null;

            if (hasFill)
            {
                fs = this.ReadFillStyle(shapeReader, format);
            }
            else
            {
                c = shapeReader.ReadRGBA();
            }

            return new LineStyle()
            {
                Width = width,
                StartCap = startCap,
                EndCap = endCap,
                Join = join,
                HasFill = hasFill,
                NoHScaling = noHScaling,
                NoVScaling = noVScaling,
                HasPixelHints = hasPixelHints,
                Colour = c,
                FillStyle = fs,
                MiterLimit = miterLimit
            };
        }
Esempio n. 13
0
        private Gradient ReadGradient(SWFDataTypeReader shapeReader, Tag format)
        {
            GradientSpread spread = (GradientSpread)shapeReader.ReadUBits(2);
            GradientInterpolation interp = (GradientInterpolation)shapeReader.ReadUBits(2);

            int numRecs = (int)shapeReader.ReadUBits(4);

            GradientRecord[] recs = new GradientRecord[numRecs];

            for (int i = 0; i < recs.Length; i++)
            {
                GradientRecord rec = new GradientRecord();
                rec.Ratio = shapeReader.ReadUI8();
                if (format == Tag.DefineShape || format == Tag.DefineShape2)
                {
                    rec.Colour = shapeReader.ReadRGB();
                }
                else if (format == Tag.DefineShape3 || format == Tag.DefineShape4)
                {
                    rec.Colour = shapeReader.ReadRGBA();
                }
                else
                {
                    throw new SWFModellerException(SWFModellerError.Internal, "Can't read gradient in shape format " + format.ToString());
                }

                recs[i] = rec;
            }

            return new Gradient()
            {
                Records = recs,
                Interpolation = interp,
                Spread = spread
            };
        }
Esempio n. 14
0
        private IShape ParseDefineShape4(SWFDataTypeReader shapeReader)
        {
            Rect bounds = shapeReader.ReadRect();
            shapeReader.Align8();
            Rect edgeBounds = shapeReader.ReadRect();
            shapeReader.Align8();

            shapeReader.ReadUBits(5); /* Reserved: 0 */

            bool usesFillWinding = shapeReader.ReadBit();
            bool usesNonScalingStrokes = shapeReader.ReadBit();
            bool usesScalingStrokes = shapeReader.ReadBit();

            ShapeDef sws = this.ReadShapeDef(shapeReader, Tag.DefineShape4, true, null, null);

            return new Shape()
            {
                ShapeDef = sws,
                Bounds = bounds,
                UsesScalingStrokes = usesScalingStrokes,
                UsesNonScalingStrokes = usesNonScalingStrokes,
                UsesFillWinding = usesFillWinding
            };
        }