# `GSLayer drawInPen:openPen:`

*Instance Method*

Emits the layer to separate pens for closed and open paths.

## Declaration

```swift
func draw(inPen pen: any GSPenProtocol & NSObjectProtocol, openPen: (any GSPenProtocol & NSObjectProtocol)?)
```

```objc
- (void) drawInPen:(NSObject<GSPenProtocol> *) pen openPen:(NSObject<GSPenProtocol> *) openPen;
```

```python
drawInPen_openPen_(pen: NSObject<GSPenProtocol>, openPen: NSObject<GSPenProtocol>)
```

## Parameters

- `pen` — The pen that receives closed paths and components.
- `openPen` — The pen that receives open paths.

## Discussion

Pass `nil` for `openPen` to omit open paths. Full-color layers include their paint when `pen` supports it.

## See Also

### Pen Drawing

- [`GSLayer drawInPen:`](/Core/GlyphsCore/GSLayer/drawInPen:) — Emits the layer to a pen.
- [`GSLayer drawSimpleInPen:`](/Core/GlyphsCore/GSLayer/drawSimpleInPen:) — Emits the layer’s shapes without layer-level paint processing.
- [`GSLayer drawBlackInPen:openPen:`](/Core/GlyphsCore/GSLayer/drawBlackInPen:openPen:) — Emits the layer without full-color paint processing.
- [`GSLayer drawColorInPen:`](/Core/GlyphsCore/GSLayer/drawColorInPen:) — Emits the painted drawing operations of a full-color layer to a pen.
- [`GSLayer drawDrawStack:inPen:`](/Core/GlyphsCore/GSLayer/drawDrawStack:inPen:) — Emits the path and error operations of a draw stack to a pen.

