                     self.append(line)
                 } while g.next() != nil && !commandsymbol.contains(g.current.utf8.first!)
             case "H":
+                if self.count == 0 || self.last is SDPath.ClosePath {
+                    let move = SDPath.Move(start)
+                    relative = move.point
+                    lastcontrol = move.point
+                    lastbezier = 0
+                    self.append(move)
+                }
                 repeat {
                     let line = SDPath.Line(x: try toDouble(g.current), y: relative.y)
                     relative = line.point

                    self.append(line)
                } while g.next() != nil && !commandsymbol.contains(g.current.utf8.first!)
            case "h":
                repeat {
                    let line = SDPath.Line(x: try toDouble(g.current) + relative.x, y: relative.y)
                    relative = line.point

                    self.append(move)
                } while g.next() != nil && !commandsymbol.contains(g.current.utf8.first!)
            case "L":
                if self.count == 0 || self.last is SDPath.ClosePath {
                    let move = SDPath.Move(start)
                    relative = move.point
                    lastcontrol = move.point
                    lastbezier = 0
                    self.append(move)
                }
                repeat {
                    let line = SDPath.Line(x: try toDouble(g.current), y: try toDouble(g.next()))
                    relative = line.point
