gre.rtext_text_extent
gre.rtext_text_extent(text, target, table)
Gets the extent of a rich text field
Parameters
| Parameter | Type | Description |
|---|---|---|
text | #string | the rich text string to extent |
target | #string | A string containing the parent control of the rich text rext you are targeting. This will target the first rich text rext found on the control. If one is found then the extent calculation will use that rich text rext's parameters. |
table | #table | A table containing optional parameters Optional parameters, see Rich Text Options Table. |
Rich Text Options Table
These will override any parameters found in the targeted rich text rext.
| Key | Type | Description |
|---|---|---|
size | #number | The font size to use when calculating extent |
line-height | #number | The line height to use when calculating extent. This is a percentage of the font line height. |
max-width | #number | The max width to use when calculating extent. |
regular-font | #string | The regular font to use. |
bold-font | #string | The bold font to use. |
italic-font | #string | The italic font to use. |
italic-bold-font | #string | The italic/bold font to use. |
Returns
A #table containing the following information about the rich text size:
| Key | Type | Description |
|---|---|---|
width | #number | The width of the text area. |
height | #number | The height of the text area. |