Font
class represents fonts and font metrics. Fonts
cannot be created by applications. Instead, applications query for fonts based on font attributes and the system will attempt to provide a font that matches the requested attributes as closely as possible. A Font's
attributes are style, size, and face. Values for attributes must be specified in terms of symbolic constants. Values for the style attribute may be combined using the bit-wise OR
operator, whereas values for the other attributes may not be combined. For example, the value
STYLE_BOLD | STYLE_ITALIC
may be used to specify a bold-italic font; however
SIZE_LARGE | SIZE_SMALL
is illegal.
The values of these constants are arranged so that zero is valid for each attribute and can be used to specify a reasonable default font for the system. For clarity of programming, the following symbolic constants are provided and are defined to have values of zero:
STYLE_PLAIN
SIZE_MEDIUM
FACE_SYSTEM
Values for other attributes are arranged to have disjoint bit patterns in order to raise errors if they are inadvertently misused (for example, using FACE_PROPORTIONAL
where a style is required). However, the values for the different attributes are not intended to be combined with each other.
|
|
|
|
|
|
|
|