Skip to main content
Version: 9.0.2

gre.rtext_text_extent

gre.rtext_text_extent(text, target, table)

Gets the extent of a rich text field

Parameters

ParameterTypeDescription
text#stringthe rich text string to extent
target#stringA 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#tableA 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.

KeyTypeDescription
size#numberThe font size to use when calculating extent
line-height#numberThe line height to use when calculating extent. This is a percentage of the font line height.
max-width#numberThe max width to use when calculating extent.
regular-font#stringThe regular font to use.
bold-font#stringThe bold font to use.
italic-font#stringThe italic font to use.
italic-bold-font#stringThe italic/bold font to use.

Returns

A #table containing the following information about the rich text size:

KeyTypeDescription
width#numberThe width of the text area.
height#numberThe height of the text area.