ClassesClassesClassesClasses | | | | Operators

set_fontset_fontSetFontset_fontSetFontSetFont (Operator)

Name

set_fontset_fontSetFontset_fontSetFontSetFont — Set the font used for text output.

Signature

set_font( : : WindowHandle, Font : )

Herror set_font(const Hlong WindowHandle, const char* Font)

Herror T_set_font(const Htuple WindowHandle, const Htuple Font)

Herror set_font(const HTuple& WindowHandle, const HTuple& Font)

void HWindow::SetFont(const HTuple& Font) const

void SetFont(const HTuple& WindowHandle, const HTuple& Font)

void HWindow::SetFont(const HString& Font) const

void HWindow::SetFont(const char* Font) const

void HOperatorSetX.SetFont(
[in] VARIANT WindowHandle, [in] VARIANT Font)

void HWindowX.SetFont([in] BSTR Font)

static void HOperatorSet.SetFont(HTuple windowHandle, HTuple font)

void HWindow.SetFont(string font)

Description

set_fontset_fontSetFontset_fontSetFontSetFont sets the font FontFontFontFontFontfont for the output window WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle. All subsequent text outputs (e.g., with the operators disp_textdisp_textDispTextdisp_textDispTextDispText, write_stringwrite_stringWriteStringwrite_stringWriteStringWriteString or read_stringread_stringReadStringread_stringReadStringReadString) will now use the new font instead of the default font (see set_system('default_font',Font)set_system("default_font",Font)SetSystem("default_font",Font)set_system("default_font",Font)SetSystem("default_font",Font)SetSystem("default_font",Font)). All available fonts can be queried with query_fontquery_fontQueryFontquery_fontQueryFontQueryFont.

The syntax for the specification of FontFontFontFontFontfont is the following:

FONTNAME[-STYLE]-FONT_SIZE.

The optional STYLE may be one of the following (other values are possible as well):

The FONT_SIZE is measured in pixels.

An example of a valid string for FontFontFontFontFontfont would be

'Courier-Bold-14'.

Attention

For different machines the available fonts may differ a lot. Therefore it is suggested to use the operator query_fontquery_fontQueryFontquery_fontQueryFontQueryFont or the procedure set_display_font.

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Window handle.

FontFontFontFontFontfont (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Name of new font.

Example (HDevelop)

dev_get_window (WindowHandle)
query_font (WindowHandle, Font)
* Specify font name and size
FontWithSize := Font[0]+'-20'
set_font (WindowHandle, FontWithSize)
dev_disp_text ('Font set to: '+FontWithSize, 'window', 20, 12, 'black', [], [])
* Specify font name, style, and size
FontWithStyleAndSize := Font[0]+'-Bold-20'
set_font (WindowHandle, FontWithStyleAndSize)
dev_disp_text ('Font set to: '+FontWithStyleAndSize, 'window', 50, 12, 'black', [], [])

Result

set_fontset_fontSetFontset_fontSetFontSetFont returns 2 (H_MSG_TRUE) if the font name can be resolved. Otherwise an exception is raised.

Possible Predecessors

open_windowopen_windowOpenWindowopen_windowOpenWindowOpenWindow

Possible Successors

query_fontquery_fontQueryFontquery_fontQueryFontQueryFont

See also

get_fontget_fontGetFontget_fontGetFontGetFont, query_fontquery_fontQueryFontquery_fontQueryFontQueryFont, open_windowopen_windowOpenWindowopen_windowOpenWindowOpenWindow

Module

Foundation


ClassesClassesClassesClasses | | | | Operators