# `GSLayer drawDrawStack:inPen:`

*Instance Method*

Emits the path and error operations of a draw stack to a pen.

## Declaration

```swift
func drawDrawStack(_ drawStack: [GSDrawSlice<AnyObject>], inPen pen: any GSPenProtocol & NSObjectProtocol)
```

```objc
- (void) drawDrawStack:(NSArray<GSDrawSlice *> *) drawStack inPen:(NSObject<GSPenProtocol> *) pen;
```

```python
drawDrawStack_inPen_(drawStack: list[GSDrawSlice], pen: NSObject<GSPenProtocol>)
```

## Parameters

- `drawStack` — The drawing operations to emit.
- `pen` — The pen that receives the operations and their paint attributes.

## See Also

### Pen Drawing

- [`GSLayer drawInPen:`](/Core/GlyphsCore/GSLayer/drawInPen:) — Emits the layer to a pen.
- [`GSLayer drawInPen:openPen:`](/Core/GlyphsCore/GSLayer/drawInPen:openPen:) — Emits the layer to separate pens for closed and open paths.
- [`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.

