Operator Reference

get_font_extentsT_get_font_extentsGetFontExtentsGetFontExtentsget_font_extents (Operator)

get_font_extentsT_get_font_extentsGetFontExtentsGetFontExtentsget_font_extents — Get the maximum size of all characters of a font.

Signature

get_font_extents( : : WindowHandle : MaxAscent, MaxDescent, MaxWidth, MaxHeight)

Herror T_get_font_extents(const Htuple WindowHandle, Htuple* MaxAscent, Htuple* MaxDescent, Htuple* MaxWidth, Htuple* MaxHeight)

void GetFontExtents(const HTuple& WindowHandle, HTuple* MaxAscent, HTuple* MaxDescent, HTuple* MaxWidth, HTuple* MaxHeight)

HTuple HWindow::GetFontExtents(HTuple* MaxDescent, HTuple* MaxWidth, HTuple* MaxHeight) const

Hlong HWindow::GetFontExtents(Hlong* MaxDescent, Hlong* MaxWidth, Hlong* MaxHeight) const

static void HOperatorSet.GetFontExtents(HTuple windowHandle, out HTuple maxAscent, out HTuple maxDescent, out HTuple maxWidth, out HTuple maxHeight)

HTuple HWindow.GetFontExtents(out HTuple maxDescent, out HTuple maxWidth, out HTuple maxHeight)

int HWindow.GetFontExtents(out int maxDescent, out int maxWidth, out int maxHeight)

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_extentsGetFontExtentsGetFontExtentsget_font_extents queries the maximum width (MaxWidthMaxWidthMaxWidthmaxWidthmax_width), height (MaxHeightMaxHeightMaxHeightmaxHeightmax_height), and extension above and below the baseline (MaxAscentMaxAscentMaxAscentmaxAscentmax_ascent and MaxDescentMaxDescentMaxDescentmaxDescentmax_descent, respectively) of the font that is currently set for the window WindowHandleWindowHandleWindowHandlewindowHandlewindow_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

WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (input_control)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Window handle.

MaxAscentMaxAscentMaxAscentmaxAscentmax_ascent (output_control)  extent.y HTupleUnion[int, float]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Maximum height above baseline.

MaxDescentMaxDescentMaxDescentmaxDescentmax_descent (output_control)  extent.y HTupleUnion[int, float]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Maximum extension below baseline.

MaxWidthMaxWidthMaxWidthmaxWidthmax_width (output_control)  extent.x HTupleUnion[int, float]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Maximum character width.

MaxHeightMaxHeightMaxHeightmaxHeightmax_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_extentsGetFontExtentsGetFontExtentsget_font_extents returns 2 ( H_MSG_TRUE) if the window is valid. Otherwise an exception is raised.

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowopen_window, set_fontset_fontSetFontSetFontset_font

Possible Successors

set_tpositionset_tpositionSetTpositionSetTpositionset_tposition, write_stringwrite_stringWriteStringWriteStringwrite_string, read_stringread_stringReadStringReadStringread_string, read_charread_charReadCharReadCharread_char

See also

get_string_extentsget_string_extentsGetStringExtentsGetStringExtentsget_string_extents, set_tpositionset_tpositionSetTpositionSetTpositionset_tposition, set_fontset_fontSetFontSetFontset_font

Module

Foundation