Get the spatial size of a string.
get_string_extents queries width and height of the output size of a string using the font of the window. In addition the extension above and below the current baseline for writing is returned (Ascent bzw. Descent).
The sizes are measured in the coordinate system of the window (for text windows in pixels). Using get_string_extents it is possible to determine text output and input independently from the used font. The conversion from integer numbers and floating point numbers to text strings is the same as in write_string.
|
WindowHandle (input_control) |
window -> integer |
| Window identifier. | |
|
Values (input_control) |
string(-array) -> string / real / integer |
| Values to consider. | |
| Default value: 'test_string' | |
|
Ascent (output_control) |
integer -> integer |
| Maximum height above baseline for writing. | |
|
Descent (output_control) |
integer -> integer |
| Maximum extension below baseline for writing. | |
|
Width (output_control) |
integer -> integer |
| Text width. | |
|
Height (output_control) |
integer -> integer |
| Text height. | |
get_string_extents returns 2 (H_MSG_TRUE) if the window is valid. Otherwise an exception handling is raised.
get_string_extents is reentrant, local, and processed without parallelization.
open_window, open_textwindow, set_font
set_tposition, write_string, read_string, read_char
Foundation