                 }
                 bezierPath.addCurve(to: next, controlPoint1: xy1!, controlPoint2: nextCubic)
                 setCubicPoint(next, cubic: nextCubic)
+            }
+        }
+
+        func q(_ x1: Double, y1: Double, x: Double, y: Double) {
+            if let cur = currentPoint {
+                let dx = Double(cur.x)
+                let dy = Double(cur.y)
+                Q(x1 + dx, y1: y1 + dy, x: x + dx, y: y + dy)
+            }
+        }
+        
+        func Q(_ x1: Double, y1: Double, x: Double, y: Double) {
+            let endPoint = CGPoint(x: x, y: y)
+            let controlPoint = CGPoint(x: x1, y: y1)
+            bezierPath.addQuadCurve(to: endPoint, controlPoint: controlPoint)
+            setQuadrPoint(endPoint, quadr: controlPoint)
+        }
+        
+        func t(_ x: Double, y: Double) {
+            if let cur = currentPoint {
+                let next = CGPoint(x: CGFloat(x) + cur.x, y: CGFloat(y) + cur.y)
+                var quadr: CGPoint?
+                if let curQuadr = quadrPoint {
+                    quadr = CGPoint(x: 2 * cur.x - curQuadr.x, y: 2 * cur.y - curQuadr.y)
+                } else {
+                    quadr = cur
+                }
+                bezierPath.addQuadCurve(to: next, controlPoint: quadr!)
+                setQuadrPoint(next, quadr: quadr!)
+            }
+        }
+        
+        func T(_ x: Double, y: Double) {
+            if let cur = currentPoint {
+                let next = CGPoint(x: CGFloat(x), y: CGFloat(y))
+                var quadr: CGPoint?
+                if let curQuadr = quadrPoint {
+                    quadr = CGPoint(x: 2 * cur.x - curQuadr.x, y: 2 * cur.y - curQuadr.y)
+                } else {
+                    quadr = cur
+                }
+                bezierPath.addQuadCurve(to: next, controlPoint: quadr!)
+                setQuadrPoint(next, quadr: quadr!)
             }
         }
 

                    s(data[0], y2: data[1], x: data[2], y: data[3])
                    data.removeSubrange((0 ..< 4))
                }
            case .A:
                let flags = numToBools(data[3])
                A(data[0], ry: data[1], angle: data[2], largeArc: flags[0], sweep: flags[1], x: data[4], y: data[5])

            bezierPath.close()
        }

        func setQuadrPoint(_ p: CGPoint, quadr: CGPoint) {
            currentPoint = p
            quadrPoint = quadr
            cubicPoint = nil
        }

        func setCubicPoint(_ p: CGPoint, cubic: CGPoint) {
            currentPoint = p
            cubicPoint = cubic
