Member variable XbpFont():weightClass Foundation

Determines the weight or thickness of a font.

Attribute: EXPORTED
Data type: Numeric (XBPFONT_WEIGHT_DONT_CARE)
Description

The instance variable :weightClass defines the thickness of a line or a letter within a font. The symbolic constants listed in the following table are defined in the XBP.CH #include file for use with :weightClass:

#define constants for oXbpFont:weightClass
Constant
XBPFONT_WEIGHT_DONT_CARE
XBPFONT_WEIGHT_ULTRA_LIGHT
XBPFONT_WEIGHT_EXTRA_LIGHT
XBPFONT_WEIGHT_LIGHT
XBPFONT_WEIGHT_SEMI_LIGHT
XBPFONT_WEIGHT_NORMAL
XBPFONT_WEIGHT_SEMI_BOLD
XBPFONT_WEIGHT_BOLD
XBPFONT_WEIGHT_EXTRA_BOLD
XBPFONT_WEIGHT_ULTRA_BOLD

When the method :create() is executed, the font object attempts to select a font with the weight specified in :weightClass that most closely matches the properties specified in the font object's properties. If this contains the default value (:XBPFONT_WEIGHT_DONT_CARE), font weight is ignored in the matching process and the first font matching the other properties specified for the font object is selected.

After creation of the font object, :weightClass contains a numeric value corresponding to the weight (thickness) of the font selected.

Font weight is also affected by the instance variable :bold. Generally, :weightClass has precedence over this property. However, if :weightClass contains the value XBPFONT_WEIGHT_DONT_CARE(the default value) and :bold contains .T. (true), a bold font with a weight equivalent to XPBFONT_WEIGHT_BOLD is selected, if possible.

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.