Method XbpCrt():setFontCompoundName() Foundation

Sets or returns the font "compound name".

Syntax
:setFontCompoundName( [<cCompoundName>] ) --> cOldName | NIL
Parameters
<cCompoundName>
<cCompoundName> is a character string containing the compound name of a font. It consists of the point size followed by the name of the font family plus an optional font attribute "normal", "italic" or "bold" (for example, "10.Courier Italic"). The optional attribute defaults to "normal".
Note that the optional font attribute is translated to the language that corresponds with the country version of Windows.
Return

This method returns the "compound name" of the font that was current before the method was called. If a new "compound name" is not specified, the method simply returns the "compound name" of the current font.

Description

The method :setFontCompoundName() sets the default font that is used within the XbpCrt to display text. It is also used for the output of text-mode commands such as @...SAY. Contrary to method :setFont(), :setFontCompoundName() allows fonts to be selected without requiring an XbpFont object.

The font can be set using #define constants from the FONT.CH file. This is the preferred way and assures platform and language independence of programs, since font names vary between operating systems and countries.

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 <cCompoundName> must be a fixed font. Otherwise, a run-time error is generated. For displaying graphics using text-mode commands like @...BOX, the font must 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. Depending on the type of font selected, the system automatically performs ANSI-OEM conversion prior to outputting text. See SET CHARSET for further information.

Feedback

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.