set_fontπ
Short descriptionπ
set_font β Set the font used for text output.
Signatureπ
set_font( window WindowHandle, string Font )
Descriptionπ
set_font sets the font Font for the output window
WindowHandle. All subsequent text outputs (e.g., with
the operators disp_text, write_string or read_string)
will now use the new font instead of the default font (see
set_system('default_font',Font)).
All available fonts can be queried with query_font.
The syntax for the specification of Font is the following:
FONTNAME[-STYLE]-FONT_SIZE.
The optional STYLE may be one of the following (other values are possible as well):
-
Normal,
-
Bold,
-
BoldItalic, or
-
Italic.
The FONT_SIZE is measured in pixels.
An example of a valid string for Font 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_font or the procedure
set_display_font.
Execution informationπ
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π
WindowHandle (input_control) window β (handle)
Window handle.
Font (input_control) string β (string)
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_font returns 2 (H_MSG_TRUE) if the font name can be resolved.
Otherwise an exception is raised.
Combinations with other operatorsπ
Combinations
Possible predecessors
Possible successors
See also
Moduleπ
Foundation