Method XbpFont():create() Foundation

Selects a font that corresponds with the instance variables of the XbpFont object.

Syntax
:create( [<cFontName>|<nFontId>] ) --> self
Parameters
<cFontName>
The optional parameter <cFontName> can be used to specify the name of the font to be loaded. The parameter <cFontName> is a character expression starting with a number specifying the point size. After the point size must be a period followed by the complete name of the font as it is defined in the instance variable :compoundName.
Alternatively constant defined in FONT.CH can be used for <cFontName>. Constants for four different fonts in four sizes and two constants for the attributes Bold and Italic are available.
Default fixed system font (screen font)
FONT_DEFFIXED_SMALL
FONT_DEFFIXED_MEDIUM
FONT_DEFFIXED_LARGE
FONT_DEFFIXED_XLARGE
Default proportional system font (screen font)
FONT_DEFPROP_SMALL
FONT_DEFPROP_MEDIUM
FONT_DEFPROP_LARGE
FONT_DEFPROP_XLARGE
Helvetica font (screen and printer font)
FONT_HELV_SMALL
FONT_HELV_MEDIUM
FONT_HELV_LARGE
FONT_HELV_XLARGE
Courier font (screen and printer font)
FONT_COURIER_SMALL
FONT_COURIER_MEDIUM
FONT_COURIER_LARGE
FONT_COURIER_XLARGE
Times (screen and printer font)
FONT_TIMES_SMALL
FONT_TIMES_MEDIUM
FONT_TIMES_LARGE
FONT_TIMES_XLARGE
Additional constants
FONT_STYLE_BOLD
FONT_STYLE_ITALIC

Using parameter :<cFontName> to describe a font to be created essentially causes the values assigned to the font object's properties, such as :familyName or :codePage, to be ignored.

<nFontId>
The optional parameter <nFontId> specifies the identifier of a system default font. Font identifiers begin with the prefix XBPSYSFNT_ and are defined in the file XBP.CH
Return

This method returns the object executing the method (self).

Description

After the font has been described by assigning values to the instance variables of the XbpFont object, the font must be loaded into memory by the operating system. This is done when the method :create() is called. After the method terminates, the instance variables of the object contain the definition of the font that has actually been created.

When the optional parameter <cFontName> is passed, it must contain a character expression that begins with the point size and is followed by the complete name of the font. In this case, the font properties specified in the font object's instance variable are ignored. The same is true if a font identifier is passed in the <nFontId> parameter. This causes one of the pre-defined system fonts to be created by the font object.

If the font height and name attributes are insufficient to describe the desired font, the <cFontName> and <nFontId> parameter must be omitted. In this case, the font object attempts to select a font that most closely matches the font object's properties.

The method :create() does not create the XbpFont object (which was created using the class method :new()), but loads the described font into memory. This is analogous to opening and closing a file.

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.