# `GSLayer flattenOutlinesRemoveOverlap:origHints:supporting:secondaryPath:extraHandles:error:`

*Instance Method*

Replaces the layer contents with flattened path outlines for a drawing feature set.

## Declaration

```swift
func flattenOutlinesRemoveOverlap(_ removeOverlap: Bool, origHints: [GSHint]?, supporting supportedFeatures: GSDrawStackFeature, secondaryPath: NSBezierPath?, extraHandles: NSMutableArray?) throws
```

```objc
- (BOOL) flattenOutlinesRemoveOverlap:(BOOL) removeOverlap origHints:(NSArray<GSHint *> *) origHints supporting:(GSDrawStackFeature) supportedFeatures secondaryPath:(NSBezierPath *) secondaryPath extraHandles:(NSMutableArray *) extraHandles error:(NSError **) error;
```

```python
flattenOutlinesRemoveOverlap_origHints_supporting_secondaryPath_extraHandles_error_(removeOverlap: bool, origHints: list[GSHint], supportedFeatures: GSDrawStackFeature, secondaryPath: NSBezierPath, extraHandles: list) -> tuple[bool, NSError]
```

## Parameters

- `removeOverlap` — Whether to remove overlaps from outlines of moderate complexity.
- `origHints` — Original hints that receive updated corner representation data.
- `supportedFeatures` — Shape composition features that may remain in the flattened result.
- `secondaryPath` — A path to which the original path outlines are appended.
- `extraHandles` — A collection to which handles produced while flattening are appended.
- `error` — On output, a pointer to an error object that describes why the method failed, or `nil` if no error occurred. If you are not interested in the error information, pass `nil` for this parameter.

## Return Value

Whether the outlines were flattened successfully.

## Discussion

Components, stroke paint, masks, and other unsupported shape composition are resolved into paths.

## See Also

### Flattening Outlines

- [`GSLayer flattenOutlines`](/Core/GlyphsCore/GSLayer/flattenOutlines) — Replaces the layer contents with their flattened path outlines and removes overlaps.
- [`GSLayer flattenOutlinesRemoveOverlap:origHints:secondaryPath:extraHandles:error:`](/Core/GlyphsCore/GSLayer/flattenOutlinesRemoveOverlap:origHints:secondaryPath:extraHandles:error:) — Replaces the layer contents with their flattened path outlines.

