# `GSPath pathWithString:isClosed:`

*Initializer*

Creates a path from a sequence of node element strings.

## Declaration

```swift
convenience init?(string pathString: String, isClosed: Bool)
```

```objc
+ (instancetype) pathWithString:(NSString *) pathString isClosed:(BOOL) isClosed;
```

```python
pathWithString_isClosed_(pathString: str, isClosed: bool) -> GSPath
```

## Parameters

- `isClosed` — Whether to create a closed path.

## Discussion

Separate node element strings with semicolons. Do not include surrounding quotation marks or trailing whitespace.

For example:

```
@"369 29 o;450 61 o;509 118 o;542 196 o;542 241 qs;542 324 o;482 381 q;322 29 l"
```

May return `nil` when the path string cannot be parsed.

## See Also

### Creating a Path

- [`GSPath initWithDict:format:`](/Core/GlyphsCore/GSPath/initWithDict:format:) — Creates a path from a Glyphs file dictionary representation.
- [`GSPath initWithGlyphsParser:format:`](/Core/GlyphsCore/GSPath/initWithGlyphsParser:format:) — Creates a path from the Glyphs file representation at the current parser position.
- [`GSPath pathWithRect:`](/Core/GlyphsCore/GSPath/pathWithRect:) — Creates a closed rectangular path enclosing the rectangle.
- [`GSPath circleWithRect:`](/Core/GlyphsCore/GSPath/circleWithRect:) — Creates a closed cubic path approximating an ellipse inside the rectangle.
- [`GSPath circleWithCenter:radius:`](/Core/GlyphsCore/GSPath/circleWithCenter:radius:) — Creates a closed cubic path approximating a circle.
- [`GSPath ellipseWithCenter:radius1:radius2:angle:`](/Core/GlyphsCore/GSPath/ellipseWithCenter:radius1:radius2:angle:) — Creates a closed cubic path approximating an ellipse.

