Method XbpCrt():setFont() Foundation

Sets or returns a font object used by the XbpCrt window.

:setFont( [<oXbpFont>] ) --> oXbpCurrentFont | NIL
<oXbpFont> is a font object that determines the font for textual output in the XbpCrt object.

The :setFont() method returns the current font object. When a new font is set, this method returns the previously set font object.


The :setFont() method works on the basis of an XbpFont object rather than a font compound name like the method :setFontCompoundName(). This allows for configuring an XbpFont object in detail and using it as the default font in an application window. The font is used to display text in a XbpCrt object. This includes the output of text-mode commands such as @..SAY.

After the font is installed, :setFont() updates the values in instance variables :fontName, :fontWidth and :fontHeight to reflect the properties of the font selected. Also, setting a new font for a XbpCrt window may impact the object's dimensions. See method :setSize() as well as the instance variables :fontWidth and :fontHeight for further information.

The font specified in <oXbpFont> must be a font with a fixed width. Otherwise, a run-time error occurs. For displaying graphics using text-mode commands like @...BOX, the font must also contain special graphical characters which may not be found in ANSI fonts. Therefore, it is recommended to select an OEM font for text mode output. In order to create a fixed font, XbpFont:fixedhas to be set to .T. (true) before creating the font. To create an OEM font, the value 255 has to be specified in the XbpFont:codePage instance variable before executing the font object's :create() method. Depending on the type of font selected, the system automatically performs ANSI-OEM conversion prior to outputting text. See SET CHARSET for further information.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.