Member variable XbpFont():width Foundation

Determines the width of font characters.

Attribute: EXPORTED
Data type: Numeric (0)
Description

The instance variable :width contains the width of the font. This is used with the instance variable :height to determine the type size of the font. The interpretation of the font width depends on the units set for the presentation space the font object is used with, see XbpPresSpace() and :new(). When doing output to the screen, the value in :width normally corresponds to the number of pixels taken up by the font's characters. When output is sent to a printer, the presentation space will normally be configured to use device independent units of measurement, such as GRA_PU_LOMETRIC. In this case, the font width would be interpreted to be specified in 1/10 millimeter.

When the :create() method of a font object is executed, the font object attempts to select a font of the width specified in the :widthinstance variable that most closely matches the font object's properties. If this contains the value 0, width is ignored during the matching process and a font of the default width is selected. After creation of the font object, :width contains the width of the font selected.

In order to prevent distortion of text rendered using the font object, :width should generally be set to 0 (or left at its default value). This is especially true when using the :nominalPointSize property to specify the font height using typographical units ("points").

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.