---
title: "CTLineGetBoundsWithOptions(_:_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctlinegetboundswithoptions(_:_:)"
---

# CTLineGetBoundsWithOptions(_:_:)

Calculates the bounds for a line.

## Declaration

```swift
func CTLineGetBoundsWithOptions(_ line: CTLine, _ options: CTLineBoundsOptions) -> CGRect
```

## Parameters

- `line`: The line for which you calculate the bounds.
- `options`: Desired options or 0 if none.

## Return Value

Return Value The bounds of the line as specified by the type and options, such that the coordinate origin is coincident with the line origin and the rect origin is at the bottom left. If the line is invalid, this function will return CGRectNull.

## See Also

### Related Documentation

- [CTLineBoundsOptions](coretext/ctlineboundsoptions.md)

### Measuring the Glyph Run

- [CTRunGetTypographicBounds(_:_:_:_:_:)](coretext/ctrungettypographicbounds(_:_:_:_:_:).md)
- [CTRunGetImageBounds(_:_:_:)](coretext/ctrungetimagebounds(_:_:_:).md)
- [CTRunGetBaseAdvancesAndOrigins(_:_:_:_:)](coretext/ctrungetbaseadvancesandorigins(_:_:_:_:).md)
