# GetPreferredHeight(string, TextGenerationSettings)

> Given a string and settings, returns the preferred height for a container that would hold this text.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.TextRenderingModule

```csharp
public float GetPreferredHeight(string str, TextGenerationSettings settings)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Generation text.**** (\[TextGenerationSettings]\(/engine/6000.0/script-reference/unityengine/textgenerationsettings)): Settings for generation.

### Returns

| Type                                                          | Description       |
| ------------------------------------------------------------- | ----------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | Preferred height. |
