get_string_extents ( : : Values : Ascent, Descent, Width, Height )

Query 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 current 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.


Parameters

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.


Result

get_string_extents returns TRUE, if a window is activated. Otherwise an exception is raised.


Possible Predecessors

open_window, set_window, open_textwindow, search_font, set_font


Possible Successors

set_tposition, write_string, read_string, read_char


See also

set_tposition, set_font, search_font



Copyright © 1996-1997 MVTec Software GmbH