get_font_extentsT_get_font_extentsGetFontExtentsGetFontExtentsget_font_extents (Operator)
Name
get_font_extentsT_get_font_extentsGetFontExtentsGetFontExtentsget_font_extents
— Get the maximum size of all characters of a font.
Signature
def get_font_extents(window_handle: HHandle) -> Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]
Description
get_font_extentsget_font_extentsGetFontExtentsGetFontExtentsGetFontExtentsget_font_extents
queries the maximum width
(MaxWidthMaxWidthMaxWidthMaxWidthmaxWidthmax_width
), height (MaxHeightMaxHeightMaxHeightMaxHeightmaxHeightmax_height
), and extension
above and below the baseline (MaxAscentMaxAscentMaxAscentMaxAscentmaxAscentmax_ascent
and
MaxDescentMaxDescentMaxDescentMaxDescentmaxDescentmax_descent
, respectively) of the font that is currently set
for the window WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle
. The sizes are measured in
pixels.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle
(input_control) window →
HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Window handle.
MaxAscentMaxAscentMaxAscentMaxAscentmaxAscentmax_ascent
(output_control) extent.y →
HTupleUnion[int, float]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Maximum height above baseline.
MaxDescentMaxDescentMaxDescentMaxDescentmaxDescentmax_descent
(output_control) extent.y →
HTupleUnion[int, float]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Maximum extension below baseline.
MaxWidthMaxWidthMaxWidthMaxWidthmaxWidthmax_width
(output_control) extent.x →
HTupleUnion[int, float]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Maximum character width.
MaxHeightMaxHeightMaxHeightMaxHeightmaxHeightmax_height
(output_control) extent.y →
HTupleUnion[int, float]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Maximum character height.
Result
get_font_extentsget_font_extentsGetFontExtentsGetFontExtentsGetFontExtentsget_font_extents
returns 2 (
H_MSG_TRUE)
if the window is valid.
Otherwise an exception is raised.
Possible Predecessors
open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window
,
set_fontset_fontSetFontSetFontSetFontset_font
Possible Successors
set_tpositionset_tpositionSetTpositionSetTpositionSetTpositionset_tposition
,
write_stringwrite_stringWriteStringWriteStringWriteStringwrite_string
,
read_stringread_stringReadStringReadStringReadStringread_string
,
read_charread_charReadCharReadCharReadCharread_char
See also
get_string_extentsget_string_extentsGetStringExtentsGetStringExtentsGetStringExtentsget_string_extents
,
set_tpositionset_tpositionSetTpositionSetTpositionSetTpositionset_tposition
,
set_fontset_fontSetFontSetFontSetFontset_font
Module
Foundation